-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into nodesample-inherit
- Loading branch information
Showing
38 changed files
with
1,400 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
osu.Game.Rulesets.Catch.Tests/TestSceneCatchReplayHandling.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. 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.Testing; | ||
using osu.Game.Rulesets.Catch.Beatmaps; | ||
using osu.Game.Rulesets.Catch.UI; | ||
using osu.Game.Scoring; | ||
using osu.Game.Tests.Visual; | ||
using osuTK.Input; | ||
|
||
namespace osu.Game.Rulesets.Catch.Tests | ||
{ | ||
public partial class TestSceneCatchReplayHandling : OsuManualInputManagerTestScene | ||
{ | ||
[Test] | ||
public void TestReplayDetach() | ||
{ | ||
DrawableCatchRuleset drawableRuleset = null!; | ||
float catcherPosition = 0; | ||
|
||
AddStep("create drawable ruleset", () => Child = drawableRuleset = new DrawableCatchRuleset(new CatchRuleset(), new CatchBeatmap(), [])); | ||
AddStep("attach replay", () => drawableRuleset.SetReplayScore(new Score())); | ||
AddStep("store catcher position", () => catcherPosition = drawableRuleset.ChildrenOfType<Catcher>().Single().X); | ||
AddStep("hold down left", () => InputManager.PressKey(Key.Left)); | ||
AddAssert("catcher didn't move", () => drawableRuleset.ChildrenOfType<Catcher>().Single().X, () => Is.EqualTo(catcherPosition)); | ||
AddStep("release left", () => InputManager.ReleaseKey(Key.Left)); | ||
|
||
AddStep("detach replay", () => drawableRuleset.SetReplayScore(null)); | ||
AddStep("hold down left", () => InputManager.PressKey(Key.Left)); | ||
AddUntilStep("catcher moved", () => drawableRuleset.ChildrenOfType<Catcher>().Single().X, () => Is.Not.EqualTo(catcherPosition)); | ||
AddStep("release left", () => InputManager.ReleaseKey(Key.Left)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.