2.5 update
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using BumpCombat.Constants;
|
||||
using BumpCombat.Defense.Comparison;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace BumpCombat.Tests
|
||||
{
|
||||
public sealed class Defense25DRunLayoutTests
|
||||
{
|
||||
[Test]
|
||||
public void SameSeedSelectsTheSameValidNonCentralHomeAndCreatesTwelveRoutesAndEighteenPads()
|
||||
{
|
||||
Defense25DBattlefieldDefinition battlefield = Defense25DBattlefieldDefinition.CreateDefault();
|
||||
|
||||
Assert.That(battlefield.TryCreateLayout(7319, out Defense25DRunLayout first, out string firstError),
|
||||
Is.True, firstError);
|
||||
Assert.That(battlefield.TryCreateLayout(7319, out Defense25DRunLayout replay, out string replayError),
|
||||
Is.True, replayError);
|
||||
|
||||
Assert.That(replay.HomePosition, Is.EqualTo(first.HomePosition));
|
||||
Assert.That(first.HomePosition, Is.Not.EqualTo(UnityEngine.Vector2.zero));
|
||||
Assert.That(first.RouteCount, Is.EqualTo(12));
|
||||
Assert.That(first.PadCount, Is.EqualTo(18));
|
||||
Assert.That(first.PlayerStart, Is.EqualTo(first.HomePosition + first.PlayerStartOffset));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LayoutFailsWhenNoHomeCandidateHasTheRequiredBranchClearance()
|
||||
{
|
||||
Defense25DBattlefieldDefinition battlefield = Defense25DBattlefieldDefinition.CreateDefault();
|
||||
battlefield.MinBranchClearance = 1000f;
|
||||
|
||||
Assert.That(battlefield.TryCreateLayout(1, out _, out string error), Is.False);
|
||||
Assert.That(error, Is.Not.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user