1
0
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:
Bartłomiej Dach
2025-08-01 13:19:04 +02:00
Unverified
parent 3875bd0cf6
commit acbd6de06f
@@ -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));
}
}
}