Code smells

This commit is contained in:
2021-03-04 20:35:23 -06:00
parent e64f75e3cc
commit 7ed771d467
31 changed files with 310 additions and 339 deletions

View File

@@ -1,8 +1,7 @@
using FluentAssertions;
using Gameboard.ShogiUI.BoardState;
using Gameboard.ShogiUI.BoardState.Pieces;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PathFinding;
using System.Collections.Generic;
using System.Numerics;
namespace Gameboard.ShogiUI.UnitTests.PathFinding
@@ -10,32 +9,25 @@ namespace Gameboard.ShogiUI.UnitTests.PathFinding
[TestClass]
public class PathFinder2DShould
{
class TestElement : IPlanarElement
{
public ICollection<Path> GetPaths() => throw new System.NotImplementedException();
public bool IsUpsideDown => false;
}
[TestMethod]
public void Maths()
{
var finder = new PathFinder2D<TestElement>(new Array2D<TestElement>(5, 5));
var result = finder.IsPathable(
var result = PathFinder2D<Piece>.IsPathable(
new Vector2(2, 2),
new Vector2(7, 7),
new Vector2(1, 1)
);
result.Should().BeTrue();
result = finder.IsPathable(
result = PathFinder2D<Piece>.IsPathable(
new Vector2(2, 2),
new Vector2(7, 7),
new Vector2(0, 0)
);
result.Should().BeFalse();
result = finder.IsPathable(
result = PathFinder2D<Piece>.IsPathable(
new Vector2(2, 2),
new Vector2(7, 7),
new Vector2(-1, 1)