using AvParser.Core.Settings;
using AvParser.UI.Services;
using AvParser.UI.ViewModels;
using ReactiveUI.Primitives.Signals;
namespace AvParser.UI.HeadlessTests;
///
/// Test doubles for the headless tests.
///
///
/// Intentionally duplicated from AvParser.UI.Tests rather than shared through a fourth
/// project: these are a few lines of trivial stand-ins, and a shared test-kit assembly would have
/// to opt out of the tests/ conventions (self-executing xUnit exe) to build at all.
///
internal sealed class FakePage(string title, string iconKey = "IconHome") : PageViewModel
{
public override string Title { get; } = title;
public override string IconKey { get; } = iconKey;
}
///
internal sealed class FakeThemeService(AppTheme initial = AppTheme.System) : IThemeService, IDisposable
{
private readonly BehaviorSignal _current = new(initial);
public AppTheme Current => _current.Value;
public IObservable Changes => _current;
public void Apply(AppTheme theme)
{
if (theme != _current.Value)
{
_current.OnNext(theme);
}
}
public void Dispose() => _current.Dispose();
}