Skip to content

Commit

Permalink
Enable NRT in TestScenePresentScore
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed May 20, 2024
1 parent 2aa9328 commit 85f85de
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions osu.Game.Tests/Visual/Navigation/TestScenePresentScore.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable disable

using System;
using System.Linq;
using NUnit.Framework;
Expand All @@ -26,7 +24,7 @@ namespace osu.Game.Tests.Visual.Navigation
{
public partial class TestScenePresentScore : OsuGameTestScene
{
private BeatmapSetInfo beatmap;
private BeatmapSetInfo beatmap = null!;

[SetUpSteps]
public new void SetUpSteps()
Expand Down Expand Up @@ -64,7 +62,7 @@ public partial class TestScenePresentScore : OsuGameTestScene
Ruleset = new OsuRuleset().RulesetInfo
},
}
})?.Value;
})!.Value;
});
}

Expand Down Expand Up @@ -171,9 +169,9 @@ private void returnToMenu()
AddUntilStep("wait for menu", () => Game.ScreenStack.CurrentScreen is MainMenu);
}

private Func<ScoreInfo> importScore(int i, RulesetInfo ruleset = null)
private Func<ScoreInfo> importScore(int i, RulesetInfo? ruleset = null)
{
ScoreInfo imported = null;
ScoreInfo? imported = null;
AddStep($"import score {i}", () =>
{
imported = Game.ScoreManager.Import(new ScoreInfo
Expand All @@ -188,14 +186,14 @@ private Func<ScoreInfo> importScore(int i, RulesetInfo ruleset = null)

AddAssert($"import {i} succeeded", () => imported != null);

return () => imported;
return () => imported!;
}

/// <summary>
/// Some tests test waiting for a particular screen twice in a row, but expect a new instance each time.
/// There's a case where they may succeed incorrectly if we don't compare against the previous instance.
/// </summary>
private IScreen lastWaitedScreen;
private IScreen lastWaitedScreen = null!;

private void presentAndConfirm(Func<ScoreInfo> getImport, ScorePresentType type)
{
Expand Down

0 comments on commit 85f85de

Please sign in to comment.