mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 12:32:56 +08:00
Compare playlist item IDs instead in tests
This commit is contained in:
parent
6420971660
commit
53dbbd6d64
@ -19,7 +19,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestFirstItemSelectedByDefault()
|
public void TestFirstItemSelectedByDefault()
|
||||||
{
|
{
|
||||||
AddAssert("first item selected", () => Client.CurrentMatchPlayingItem.Value == Client.APIRoom?.Playlist[0]);
|
AddAssert("first item selected", () => Client.CurrentMatchPlayingItem.Value?.ID == Client.APIRoom?.Playlist[0].ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
AddAssert("playlist has 3 items", () => Client.APIRoom?.Playlist.Count == 3);
|
AddAssert("playlist has 3 items", () => Client.APIRoom?.Playlist.Count == 3);
|
||||||
AddAssert("last playlist item is different", () => Client.APIRoom?.Playlist[2].Beatmap.Value.OnlineID == InitialBeatmap.OnlineID);
|
AddAssert("last playlist item is different", () => Client.APIRoom?.Playlist[2].Beatmap.Value.OnlineID == InitialBeatmap.OnlineID);
|
||||||
|
|
||||||
AddAssert("first item still selected", () => Client.CurrentMatchPlayingItem.Value == Client.APIRoom?.Playlist[0]);
|
AddAssert("first item still selected", () => Client.CurrentMatchPlayingItem.Value?.ID == Client.APIRoom?.Playlist[0].ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -43,7 +43,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
AddAssert("playlist has only one item", () => Client.APIRoom?.Playlist.Count == 1);
|
AddAssert("playlist has only one item", () => Client.APIRoom?.Playlist.Count == 1);
|
||||||
AddAssert("playlist item is expired", () => Client.APIRoom?.Playlist[0].Expired == true);
|
AddAssert("playlist item is expired", () => Client.APIRoom?.Playlist[0].Expired == true);
|
||||||
AddAssert("last item selected", () => Client.CurrentMatchPlayingItem.Value == Client.APIRoom?.Playlist[0]);
|
AddAssert("last item selected", () => Client.CurrentMatchPlayingItem.Value?.ID == Client.APIRoom?.Playlist[0].ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -55,12 +55,12 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
RunGameplay();
|
RunGameplay();
|
||||||
|
|
||||||
AddAssert("first item expired", () => Client.APIRoom?.Playlist[0].Expired == true);
|
AddAssert("first item expired", () => Client.APIRoom?.Playlist[0].Expired == true);
|
||||||
AddAssert("next item selected", () => Client.CurrentMatchPlayingItem.Value == Client.APIRoom?.Playlist[1]);
|
AddAssert("next item selected", () => Client.CurrentMatchPlayingItem.Value?.ID == Client.APIRoom?.Playlist[1].ID);
|
||||||
|
|
||||||
RunGameplay();
|
RunGameplay();
|
||||||
|
|
||||||
AddAssert("second item expired", () => Client.APIRoom?.Playlist[1].Expired == true);
|
AddAssert("second item expired", () => Client.APIRoom?.Playlist[1].Expired == true);
|
||||||
AddAssert("next item selected", () => Client.CurrentMatchPlayingItem.Value == Client.APIRoom?.Playlist[2]);
|
AddAssert("next item selected", () => Client.CurrentMatchPlayingItem.Value?.ID == Client.APIRoom?.Playlist[2].ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestFirstItemSelectedByDefault()
|
public void TestFirstItemSelectedByDefault()
|
||||||
{
|
{
|
||||||
AddAssert("first item selected", () => Client.CurrentMatchPlayingItem.Value == Client.APIRoom?.Playlist[0]);
|
AddAssert("first item selected", () => Client.CurrentMatchPlayingItem.Value?.ID == Client.APIRoom?.Playlist[0].ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -27,7 +27,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
selectNewItem(() => InitialBeatmap);
|
selectNewItem(() => InitialBeatmap);
|
||||||
|
|
||||||
AddAssert("playlist item still selected", () => Client.CurrentMatchPlayingItem.Value == Client.APIRoom?.Playlist[0]);
|
AddAssert("playlist item still selected", () => Client.CurrentMatchPlayingItem.Value?.ID == Client.APIRoom?.Playlist[0].ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -35,7 +35,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
selectNewItem(() => OtherBeatmap);
|
selectNewItem(() => OtherBeatmap);
|
||||||
|
|
||||||
AddAssert("playlist item still selected", () => Client.CurrentMatchPlayingItem.Value == Client.APIRoom?.Playlist[0]);
|
AddAssert("playlist item still selected", () => Client.CurrentMatchPlayingItem.Value?.ID == Client.APIRoom?.Playlist[0].ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
AddAssert("playlist contains two items", () => Client.APIRoom?.Playlist.Count == 2);
|
AddAssert("playlist contains two items", () => Client.APIRoom?.Playlist.Count == 2);
|
||||||
AddAssert("first playlist item expired", () => Client.APIRoom?.Playlist[0].Expired == true);
|
AddAssert("first playlist item expired", () => Client.APIRoom?.Playlist[0].Expired == true);
|
||||||
AddAssert("second playlist item not expired", () => Client.APIRoom?.Playlist[1].Expired == false);
|
AddAssert("second playlist item not expired", () => Client.APIRoom?.Playlist[1].Expired == false);
|
||||||
AddAssert("second playlist item selected", () => Client.CurrentMatchPlayingItem.Value == Client.APIRoom?.Playlist[1]);
|
AddAssert("second playlist item selected", () => Client.CurrentMatchPlayingItem.Value?.ID == Client.APIRoom?.Playlist[1].ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
Loading…
Reference in New Issue
Block a user