37 lines
831 B
C#
37 lines
831 B
C#
using FluentAssertions;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using PathFinding;
|
|
using System.Numerics;
|
|
|
|
namespace Gameboard.ShogiUI.UnitTests.PathFinding
|
|
{
|
|
[TestClass]
|
|
public class PathFinder2DShould
|
|
{
|
|
[TestMethod]
|
|
public void Maths()
|
|
{
|
|
var result = PathFinder2D<IPlanarElement>.IsPathable(
|
|
new Vector2(2, 2),
|
|
new Vector2(7, 7),
|
|
new Vector2(1, 1)
|
|
);
|
|
result.Should().BeTrue();
|
|
|
|
result = PathFinder2D<IPlanarElement>.IsPathable(
|
|
new Vector2(2, 2),
|
|
new Vector2(7, 7),
|
|
new Vector2(0, 0)
|
|
);
|
|
result.Should().BeFalse();
|
|
|
|
result = PathFinder2D<IPlanarElement>.IsPathable(
|
|
new Vector2(2, 2),
|
|
new Vector2(7, 7),
|
|
new Vector2(-1, 1)
|
|
);
|
|
result.Should().BeFalse();
|
|
}
|
|
}
|
|
}
|