Skip to content

Commit

Permalink
Add failing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzibyte committed Jul 25, 2024
1 parent 4983e5f commit 0182f3d
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions osu.Game.Tests/Visual/DailyChallenge/TestSceneDailyChallenge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,27 @@
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;

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" },
Expand All @@ -31,10 +38,22 @@ public void TestDailyChallenge()
},
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));
}
}
}

0 comments on commit 0182f3d

Please sign in to comment.