mirror of
https://github.com/ppy/osu.git
synced 2026-05-21 08:30:02 +08:00
Add failing test
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Screens.OnlinePlay.Components;
|
||||
using osu.Game.Tests.Resources;
|
||||
@@ -82,5 +85,25 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestExpiredItemsNotIncluded()
|
||||
{
|
||||
AddStep("set playlist", () =>
|
||||
{
|
||||
room.Playlist =
|
||||
[
|
||||
new PlaylistItem(new BeatmapInfo { StarRating = 1 }) { ID = TestResources.GetNextTestID(), Expired = true },
|
||||
new PlaylistItem(new BeatmapInfo { StarRating = 2 }) { ID = TestResources.GetNextTestID(), Expired = false },
|
||||
new PlaylistItem(new BeatmapInfo { StarRating = 3 }) { ID = TestResources.GetNextTestID(), Expired = true },
|
||||
new PlaylistItem(new BeatmapInfo { StarRating = 4 }) { ID = TestResources.GetNextTestID(), Expired = false },
|
||||
new PlaylistItem(new BeatmapInfo { StarRating = 5 }) { ID = TestResources.GetNextTestID(), Expired = false },
|
||||
new PlaylistItem(new BeatmapInfo { StarRating = 6 }) { ID = TestResources.GetNextTestID(), Expired = true },
|
||||
new PlaylistItem(new BeatmapInfo { StarRating = 7 }) { ID = TestResources.GetNextTestID(), Expired = true },
|
||||
];
|
||||
});
|
||||
AddAssert("minimum is 2.00*", () => this.ChildrenOfType<StarRatingDisplay>().ElementAt(0).Current.Value.Stars, () => Is.EqualTo(2));
|
||||
AddAssert("maximum is 5.00*", () => this.ChildrenOfType<StarRatingDisplay>().ElementAt(1).Current.Value.Stars, () => Is.EqualTo(5));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user