Add failing test

Add test case demonstrating the lack of update of the metadata display's
mods upon setting the Mods property in PlayerLoader.
This commit is contained in:
Bartłomiej Dach
2020-01-08 19:55:35 +01:00
parent d33a507d96
commit a3f7d3c445
2 changed files with 25 additions and 9 deletions

View File

@ -146,6 +146,18 @@ namespace osu.Game.Tests.Visual.Gameplay
AddAssert("player mods applied", () => playerMod2.Applied);
}
[Test]
public void TestModDisplayChanges()
{
var testMod = new TestMod();
AddStep("load player", () => ResetPlayer(true));
AddUntilStep("wait for loader to become current", () => loader.IsCurrentScreen());
AddStep("set test mod in loader", () => loader.Mods.Value = new[] { testMod });
AddAssert("test mod is displayed", () => (TestMod)loader.DisplayedMods.Single() == testMod);
}
[Test]
public void TestMutedNotificationMasterVolume() => addVolumeSteps("master volume", () => audioManager.Volume.Value = 0, null, () => audioManager.Volume.IsDefault);
@ -221,6 +233,8 @@ namespace osu.Game.Tests.Visual.Gameplay
public new Task DisposalTask => base.DisposalTask;
public IReadOnlyList<Mod> DisplayedMods => MetadataInfo.Mods;
public TestPlayerLoader(Func<Player> createPlayer)
: base(createPlayer)
{