Covers the pure-logic surface of commit 1:
VitalsVMTests
* HealthPercent reads from CombatState.GetHealthPercent
* safe-default 1.0 when GUID unknown / not yet set / never updated
* SetLocalPlayerGuid reroutes lookup to the new guid (no stale cache)
* StaminaPercent / ManaPercent are null for D.2a scope
* ctor throws ArgumentNullException on null CombatState
PanelContextTests
* record-struct fields round-trip
* value-based equality
NullCommandBusTests
* Publish accepts any record type without throwing
* Instance is a true singleton
csproj template mirrors AcDream.Core.Tests (xUnit 2.9.3, Test.Sdk 17.14.1,
runner 3.1.4, coverlet 6.0.4, implicit Using Xunit). References only
AcDream.UI.Abstractions — no runtime / GL dependency, tests run fast.
22 lines
496 B
C#
22 lines
496 B
C#
namespace AcDream.UI.Abstractions.Tests;
|
|
|
|
public sealed class NullCommandBusTests
|
|
{
|
|
private sealed record FakeCmd(int Value);
|
|
|
|
[Fact]
|
|
public void Publish_DoesNotThrow_OnAnyRecordType()
|
|
{
|
|
var bus = NullCommandBus.Instance;
|
|
|
|
bus.Publish(new FakeCmd(42));
|
|
bus.Publish("a string command");
|
|
bus.Publish(12345);
|
|
}
|
|
|
|
[Fact]
|
|
public void Instance_IsSingleton()
|
|
{
|
|
Assert.Same(NullCommandBus.Instance, NullCommandBus.Instance);
|
|
}
|
|
}
|