mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Merge branch 'master' into fix-failing-tests
This commit is contained in:
23
osu.Game.Tests/Visual/TestCaseExternalLinkButton.cs
Normal file
23
osu.Game.Tests/Visual/TestCaseExternalLinkButton.cs
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
public class TestCaseExternalLinkButton : OsuTestCase
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(ExternalLinkButton) };
|
||||
|
||||
public TestCaseExternalLinkButton()
|
||||
{
|
||||
Child = new ExternalLinkButton("https://osu.ppy.sh/home")
|
||||
{
|
||||
Size = new Vector2(50)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -40,13 +40,13 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
exitAction = false;
|
||||
InputManager.MoveMouseTo(quitButton);
|
||||
InputManager.ButtonDown(MouseButton.Left);
|
||||
InputManager.PressButton(MouseButton.Left);
|
||||
});
|
||||
|
||||
AddStep("Early release", () => InputManager.ButtonUp(MouseButton.Left));
|
||||
AddStep("Early release", () => InputManager.ReleaseButton(MouseButton.Left));
|
||||
AddAssert("action not triggered", () => !exitAction);
|
||||
|
||||
AddStep("Trigger exit action", () => InputManager.ButtonDown(MouseButton.Left));
|
||||
AddStep("Trigger exit action", () => InputManager.PressButton(MouseButton.Left));
|
||||
AddUntilStep(() => exitAction, $"{nameof(quitButton.Action)} was triggered");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user