public void IsAdjacentToTileWithSameXY(int x, int y, VertexTileSide side) { var tile = new Mock<ITile>(); tile.Setup(t => t.X).Returns(x); tile.Setup(t => t.Y).Returns(y); var vertex = new Vertex(x, y, side); Assert.True(vertex.IsAdjacentTo(tile.Object)); }
public void IsAdjacentToTilesRightIfTileSideRight(int vertexX, int vertexY, int tileX, int tileY, bool expected) { var tile = new Mock<ITile>(); tile.Setup(t => t.X).Returns(tileX); tile.Setup(t => t.Y).Returns(tileY); var vertex = new Vertex(vertexX, vertexY, VertexTileSide.Right); bool result = vertex.IsAdjacentTo(tile.Object); Assert.True(result == expected, $"Result: {result}, Expected: {expected}\nVertex(X: {vertexX}, Y: {vertexY}, Right); Tile(X: {tileX}, Y: {tileY}"); }
public void IsAdjacentToVertexCaseRight(int vertexX, int vertexY, int inputX, int inputY, VertexTileSide inputSide, bool expected) { var input = new Mock<IVertex>(); input.Setup(v => v.X).Returns(inputX); input.Setup(v => v.Y).Returns(inputY); input.Setup(v => v.Side).Returns(inputSide); var vertex = new Vertex(vertexX, vertexY, VertexTileSide.Right); bool result = vertex.IsAdjacentTo(input.Object); Assert.True(result == expected, $"Result: {result}, Expected: {expected}\nVertext(X: {vertexX}, Y: {vertexY}, Right); Vertex(X: {inputX}, Y: {inputY}, Side: {inputSide}"); }
public void IsAdjacentToVertexNull() { var vertex = new Vertex(1, 2, VertexTileSide.Left); Assert.False(vertex.IsAdjacentTo((IVertex)null)); }
public void IsAdjacentTOEdgeCaseRight(int vertexX, int vertexY, int edgeX, int edgeY, EdgeSide side, bool expected) { var edge = new Mock<IEdge>(); edge.Setup(e => e.X).Returns(edgeX); edge.Setup(e => e.Y).Returns(edgeY); edge.Setup(e => e.Side).Returns(side); var vertex = new Vertex(vertexX, vertexY, VertexTileSide.Right); bool result = vertex.IsAdjacentTo(edge.Object); Assert.True(result == expected, $"Result: {result}, Expected: {expected}\nVertext(X: {vertexX}, Y: {vertexY}, Right); Edge(X: {edgeX}, Y: {edgeY}, Side: {side}"); }
public void IsAdjacentToNullTile() { var vertex = new Vertex(1, 3, VertexTileSide.Left); Assert.False(vertex.IsAdjacentTo((ITile)null)); }