1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 12:45:09 +08:00

Add failing test case

This commit is contained in:
Salman Ahmed 2024-07-25 07:39:58 +03:00
parent 4983e5f33e
commit 0182f3d7c3

View File

@ -4,9 +4,12 @@
using System;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Testing;
using osu.Game.Online.API;
using osu.Game.Online.Rooms;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Screens.Ranking;
using osu.Game.Screens.SelectV2.Leaderboards;
using osu.Game.Tests.Resources;
using osu.Game.Tests.Visual.OnlinePlay;
@ -14,10 +17,14 @@ namespace osu.Game.Tests.Visual.DailyChallenge
{
public partial class TestSceneDailyChallenge : OnlinePlayTestScene
{
[Test]
public void TestDailyChallenge()
[SetUpSteps]
public override void SetUpSteps()
{
var room = new Room
base.SetUpSteps();
Room room = null!;
AddStep("add room", () => API.Perform(new CreateRoomRequest(room = new Room
{
RoomID = { Value = 1234 },
Name = { Value = "Daily Challenge: June 4, 2024" },
@ -31,10 +38,22 @@ namespace osu.Game.Tests.Visual.DailyChallenge
},
EndDate = { Value = DateTimeOffset.Now.AddHours(12) },
Category = { Value = RoomCategory.DailyChallenge }
};
})));
AddStep("add room", () => API.Perform(new CreateRoomRequest(room)));
AddStep("push screen", () => LoadScreen(new Screens.OnlinePlay.DailyChallenge.DailyChallenge(room)));
}
[Test]
public void TestDailyChallenge()
{
}
[Test]
public void TestScoreNavigation()
{
AddStep("click on score", () => this.ChildrenOfType<LeaderboardScoreV2>().First().TriggerClick());
AddUntilStep("wait for load", () => Stack.CurrentScreen is ResultsScreen results && results.IsLoaded);
AddAssert("replay download button exists", () => this.ChildrenOfType<ReplayDownloadButton>().Count(), () => Is.EqualTo(1));
}
}
}