feat(CS-P3): throne registration via Sinior/Crown talk (223/216) after defenses down + both switches held; reachable defense positions
Some checks failed
.NET Core / build (push) Has been cancelled
Some checks failed
.NET Core / build (push) Has been cancelled
This commit is contained in:
@@ -79,18 +79,18 @@ public class CastleSiegeContextTest
|
||||
// Both switches held but defenses still up -> no capture.
|
||||
ctx.SetSwitchHolder(217, "Attackers");
|
||||
ctx.SetSwitchHolder(218, "Attackers");
|
||||
Assert.That(ctx.EvaluateCapture(), Is.Null);
|
||||
Assert.That(ctx.TryCaptureThrone("Attackers").Success, Is.False);
|
||||
|
||||
ctx.NotifyDefenseDestroyed();
|
||||
ctx.NotifyDefenseDestroyed();
|
||||
|
||||
// Only one switch held -> still no capture.
|
||||
ctx.SetSwitchHolder(218, null);
|
||||
Assert.That(ctx.EvaluateCapture(), Is.Null);
|
||||
Assert.That(ctx.TryCaptureThrone("Attackers").Success, Is.False);
|
||||
|
||||
// Both switches held by the same guild + defenses down -> capture.
|
||||
// Both switches held by the same guild + defenses down -> capture at the Sinior/Crown.
|
||||
ctx.SetSwitchHolder(218, "Attackers");
|
||||
Assert.That(ctx.EvaluateCapture(), Is.EqualTo("Attackers"));
|
||||
Assert.That(ctx.TryCaptureThrone("Attackers").Success, Is.True);
|
||||
Assert.That(ctx.OccupierGuildName, Is.EqualTo("Attackers"));
|
||||
|
||||
await ctx.TickAsync(T0.AddMinutes(20)); // Siege -> Settlement
|
||||
@@ -108,17 +108,18 @@ public class CastleSiegeContextTest
|
||||
ctx.SetDefenseCount(0);
|
||||
ctx.SetSwitchHolder(217, "A");
|
||||
ctx.SetSwitchHolder(218, "B");
|
||||
Assert.That(ctx.EvaluateCapture(), Is.Null);
|
||||
Assert.That(ctx.TryCaptureThrone("A").Success, Is.False);
|
||||
Assert.That(ctx.TryCaptureThrone("B").Success, Is.False);
|
||||
}
|
||||
|
||||
/// <summary>Tests that switch holding outside the siege phase is a no-op.</summary>
|
||||
/// <summary>Tests that capturing the throne outside the siege phase is a no-op.</summary>
|
||||
[Test]
|
||||
public void SwitchHoldOutsideSiegeIsNoOp()
|
||||
public void ThroneCaptureOutsideSiegeIsNoOp()
|
||||
{
|
||||
var ctx = new CastleSiegeContext(Config());
|
||||
ctx.SetSwitchHolder(217, "A");
|
||||
ctx.SetSwitchHolder(218, "A");
|
||||
Assert.That(ctx.EvaluateCapture(), Is.Null);
|
||||
Assert.That(ctx.TryCaptureThrone("A").Success, Is.False);
|
||||
Assert.That(ctx.OccupierGuildName, Is.Null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user