Files
quiver-launcher/QuiverLauncher.Tests/GamepadConnectionStateTests.cs
T
Thomas GeorgiadisandCursor 2c85fa0370 feat: update Quiver Launcher to support .NET 10 and enhance UI/UX
- Introduce Android app
- Migrate project files to .NET 10, updating dependencies and workflows.
- Migrate project to Avalonia 12
- Refactor App.axaml to include a ResourceDictionary for theme management.
- Introduce new styles for gamepad navigation and focus rings.
- Implement hosted main view management for better application lifecycle handling.
- Remove deprecated MainWindow.Mods.cs file and related code.
- Update README to reflect changes in project structure and requirements.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 20:06:33 +10:00

50 lines
1.4 KiB
C#

using FluentAssertions;
using QuiverLauncher.Services;
namespace QuiverLauncher.Tests;
public class GamepadConnectionStateTests
{
[Theory]
[InlineData(0, 0, null)]
[InlineData(1, 1, null)]
[InlineData(2, 3, null)]
[InlineData(0, 1, true)]
[InlineData(0, 2, true)]
[InlineData(1, 0, false)]
[InlineData(3, 0, false)]
public void GetConnectionChangedSignal_only_when_crossing_zero(
int previousCount,
int nextCount,
bool? expected)
{
InputService.GetConnectionChangedSignal(previousCount, nextCount).Should().Be(expected);
}
[Theory]
[InlineData(true, true, true)]
[InlineData(true, false, false)]
[InlineData(false, true, false)]
[InlineData(false, false, false)]
public void ShouldKeepOpenController_only_when_already_open_and_attached(
bool alreadyOpen,
bool attached,
bool expected)
{
InputService.ShouldKeepOpenController(alreadyOpen, attached).Should().Be(expected);
}
[Theory]
[InlineData(true, true, false)]
[InlineData(true, false, true)]
[InlineData(false, true, false)]
[InlineData(false, false, false)]
public void ShouldReopenController_when_already_open_but_detached(
bool alreadyOpen,
bool attached,
bool expected)
{
InputService.ShouldReopenController(alreadyOpen, attached).Should().Be(expected);
}
}