mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 06:42:54 +08:00
Revert test changes
They were broken because `SerialisedDrawableInfo` is a reference type and as such equality checks will use reference equality rather than member equality.
This commit is contained in:
parent
21e1d68b15
commit
b247b94ecb
@ -4,8 +4,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
@ -216,11 +214,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
});
|
||||
|
||||
AddStep("Press undo", () => InputManager.Keys(PlatformAction.Undo));
|
||||
|
||||
AddAssert("Nothing changed",
|
||||
() => JsonConvert.DeserializeObject<IEnumerable<SerialisedDrawableInfo>>(Encoding.UTF8.GetString(defaultState)),
|
||||
() => Is.EqualTo(JsonConvert.DeserializeObject<IEnumerable<SerialisedDrawableInfo>>(Encoding.UTF8.GetString(changeHandler.GetCurrentState())))
|
||||
);
|
||||
AddAssert("Nothing changed", () => defaultState.SequenceEqual(changeHandler.GetCurrentState()));
|
||||
|
||||
AddStep("Add components", () =>
|
||||
{
|
||||
@ -249,11 +243,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
void revertAndCheckUnchanged()
|
||||
{
|
||||
AddStep("Revert changes", () => changeHandler.RestoreState(int.MinValue));
|
||||
|
||||
AddAssert("Current state is same as default",
|
||||
() => JsonConvert.DeserializeObject<IEnumerable<SerialisedDrawableInfo>>(Encoding.UTF8.GetString(defaultState)),
|
||||
() => Is.EqualTo(JsonConvert.DeserializeObject<IEnumerable<SerialisedDrawableInfo>>(Encoding.UTF8.GetString(changeHandler.GetCurrentState())))
|
||||
);
|
||||
AddAssert("Current state is same as default", () => defaultState.SequenceEqual(changeHandler.GetCurrentState()));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user