Skip to content

Commit

Permalink
Add isolated test for daily challenge intro flag
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Aug 22, 2024
1 parent 236a273 commit 9b9986b
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Game.Configuration;
using osu.Game.Online.API;
using osu.Game.Online.Metadata;
using osu.Game.Online.Rooms;
Expand Down Expand Up @@ -42,6 +43,19 @@ public void TestDailyChallenge()
AddStep("push screen", () => LoadScreen(new DailyChallengeIntro(room)));
}

[Test]
public void TestPlayIntroOnceFlag()
{
AddStep("set intro played flag", () => Dependencies.Get<SessionStatics>().SetValue(Static.DailyChallengeIntroPlayed, true));

startChallenge();

AddAssert("intro played flag reset", () => Dependencies.Get<SessionStatics>().Get<bool>(Static.DailyChallengeIntroPlayed), () => Is.False);

AddStep("push screen", () => LoadScreen(new DailyChallengeIntro(room)));
AddUntilStep("intro played flag set", () => Dependencies.Get<SessionStatics>().Get<bool>(Static.DailyChallengeIntroPlayed), () => Is.True);
}

private void startChallenge()
{
room = new Room
Expand Down

0 comments on commit 9b9986b

Please sign in to comment.