acdream/tests/AcDream.App.Tests/World/TeleportArrivalRulesTests.cs
Erik b47b21570a feat(slice2): TeleportArrivalRules.Decide — outdoor holds until landblock loaded (#145 §3.4)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 20:12:37 +02:00

66 lines
2 KiB
C#

using AcDream.App.World;
using Xunit;
namespace AcDream.App.Tests.World;
/// <summary>
/// Full truth-table for TeleportArrivalRules.Decide after the §3.4 readiness-gate change.
/// </summary>
public class TeleportArrivalRulesTests
{
[Fact]
public void Unhydratable_IsImpossible_Outdoor()
{
Assert.Equal(ArrivalReadiness.Impossible,
TeleportArrivalRules.Decide(
claimUnhydratable: true, indoor: false,
indoorCellReady: false, outdoorReady: false));
}
[Fact]
public void Unhydratable_IsImpossible_Indoor()
{
Assert.Equal(ArrivalReadiness.Impossible,
TeleportArrivalRules.Decide(
claimUnhydratable: true, indoor: true,
indoorCellReady: true, outdoorReady: false));
}
[Fact]
public void Indoor_CellReady_IsReady()
{
Assert.Equal(ArrivalReadiness.Ready,
TeleportArrivalRules.Decide(
claimUnhydratable: false, indoor: true,
indoorCellReady: true, outdoorReady: false));
}
[Fact]
public void Indoor_CellNotReady_IsNotReady()
{
Assert.Equal(ArrivalReadiness.NotReady,
TeleportArrivalRules.Decide(
claimUnhydratable: false, indoor: true,
indoorCellReady: false, outdoorReady: false));
}
[Fact]
public void Outdoor_LandblockLoaded_IsReady()
{
Assert.Equal(ArrivalReadiness.Ready,
TeleportArrivalRules.Decide(
claimUnhydratable: false, indoor: false,
indoorCellReady: false, outdoorReady: true));
}
[Fact]
public void Outdoor_LandblockNotLoaded_IsNotReady()
{
// §3.4: the #145 residual — outdoor arrival on a not-yet-streamed landblock
// must hold. Previously returned Ready immediately.
Assert.Equal(ArrivalReadiness.NotReady,
TeleportArrivalRules.Decide(
claimUnhydratable: false, indoor: false,
indoorCellReady: false, outdoorReady: false));
}
}