AddStep("Move cursor to button",()=>InputManager.MoveMouseTo(settingsButton));
AddAssert("Button is hovered",()=>settingsButton.IsHovered);
AddStep("Move cursor to padded area",()=>InputManager.MoveMouseTo(settingsButton.ScreenSpaceDrawQuad.TopLeft+newVector2(SettingsPanel.CONTENT_MARGINS/2f,10)));
AddAssert("Cursor within a button",()=>settingsButton.ScreenSpaceDrawQuad.Contains(InputManager.CurrentState.Mouse.Position));
AddAssert("Button is not hovered",()=>!settingsButton.IsHovered);
}
[Test]
publicvoidTestRoundedButtonInput()
{
AddStep("Move cursor to button",()=>InputManager.MoveMouseTo(roundedButton));
AddAssert("Button is hovered",()=>roundedButton.IsHovered);
AddStep("Move cursor to corner",()=>InputManager.MoveMouseTo(roundedButton.ScreenSpaceDrawQuad.TopLeft+Vector2.One));
AddAssert("Cursor within a button",()=>roundedButton.ScreenSpaceDrawQuad.Contains(InputManager.CurrentState.Mouse.Position));
AddAssert("Button is not hovered",()=>!roundedButton.IsHovered);
}
[Test]
publicvoidTestShearedButtonInput()
{
AddStep("Move cursor to button",()=>InputManager.MoveMouseTo(shearedButton));
AddAssert("Button is hovered",()=>shearedButton.IsHovered);
AddStep("Move cursor to corner",()=>InputManager.MoveMouseTo(shearedButton.ScreenSpaceDrawQuad.TopLeft+Vector2.One));
AddAssert("Cursor within a button",()=>shearedButton.ScreenSpaceDrawQuad.Contains(InputManager.CurrentState.Mouse.Position));
AddAssert("Button is not hovered",()=>!shearedButton.IsHovered);