mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 16:02:55 +08:00
Fix bugs and add test
This commit is contained in:
parent
0e38ff07c7
commit
0f6a6287f2
@ -0,0 +1,59 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Logging;
|
||||||
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Rulesets.Catch.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Catch.Mods;
|
||||||
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class TestSceneDrawableCatchRulesetWithRelax : OsuTestScene
|
||||||
|
{
|
||||||
|
[SetUpSteps]
|
||||||
|
public void SetUpSteps()
|
||||||
|
{
|
||||||
|
AddStep("create drawable ruleset with relax mod", () =>
|
||||||
|
{
|
||||||
|
Child = new DrawableCatchRuleset(new CatchRuleset(), new CatchBeatmap(), new List<Mod>() {
|
||||||
|
new CatchModRelax()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
AddUntilStep("wait for load", () => Child.IsLoaded);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestBasic()
|
||||||
|
{
|
||||||
|
AddAssert("check if touch catcher is showing", () => this.ChildrenOfType<CatchTouchInputMapper>().Any() == false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestFixture]
|
||||||
|
public class TestSceneDrawableCatchRulesetWithoutRelax : OsuTestScene
|
||||||
|
{
|
||||||
|
[SetUpSteps]
|
||||||
|
public void SetUpSteps()
|
||||||
|
{
|
||||||
|
AddStep("create drawable ruleset without relax mod", () =>
|
||||||
|
{
|
||||||
|
Child = new DrawableCatchRuleset(new CatchRuleset(), new CatchBeatmap(), new List<Mod>());
|
||||||
|
});
|
||||||
|
AddUntilStep("wait for load", () => Child.IsLoaded);
|
||||||
|
Logger.Log("Ready");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestBasic()
|
||||||
|
{
|
||||||
|
AddAssert("check if touch catcher is showing", () => this.ChildrenOfType<CatchTouchInputMapper>().Any());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
: base(ruleset, beatmap, mods)
|
: base(ruleset, beatmap, mods)
|
||||||
{
|
{
|
||||||
// Check if mods have RelaxMod instance
|
// Check if mods have RelaxMod instance
|
||||||
if (mods.OfType<ModRelax>().Any())
|
if (mods != null && mods.OfType<ModRelax>().Any())
|
||||||
showMobileMapper = false;
|
showMobileMapper = false;
|
||||||
|
|
||||||
Direction.Value = ScrollingDirection.Down;
|
Direction.Value = ScrollingDirection.Down;
|
||||||
|
Loading…
Reference in New Issue
Block a user