public void IsAdjacentToNorthEdges(int x, int y, int edgeX, int edgeY, 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(EdgeSide.North); var tile = new Tile(x, y, 5, MaterialType.Grain); bool result = tile.IsAdjacentTo(edge.Object); Assert.True(result == expected, $"Result: {result}, Expected: {expected}\nTile(X: {x}, Y: {y}); Edge(X: {edgeX}, Y: {edgeY}"); }
public void IsAdjacentToBottomVertex(int x, int y, int vertexX, int vertexY, VertexTileSide side, bool expected) { var vertex = new Mock<IVertex>(); vertex.Setup(i => i.X).Returns(vertexX); vertex.Setup(i => i.Y).Returns(vertexY); vertex.Setup(v => v.Side).Returns(side); var tile = new Tile(x, y, 5, MaterialType.Ore); bool result = tile.IsAdjacentTo(vertex.Object); Assert.True(result == expected, $"Result: {result}, Expected: {expected}\nTile(X: {x}, Y: {y}); Vertex(X: {vertexX}, Y: {vertexY}"); }
public void NotAdjacentToNullVertex() { var tile = new Tile(4, 4, 4, MaterialType.Grain); bool result = tile.IsAdjacentTo((IVertex)null); Assert.False(result); }
public void IsAdjacentToTiles(int x, int y, int inputX, int inputY, bool expected) { var input = new Mock<ITile>(); input.Setup(i => i.X).Returns(inputX); input.Setup(i => i.Y).Returns(inputY); var tile = new Tile(x, y, 5, MaterialType.Ore); bool result = tile.IsAdjacentTo(input.Object); Assert.True(result == expected, $"Result: {result}, Expected: {expected}\nTile(X: {x}, Y: {y}); Tile(X: {inputX}, Y: {inputY}"); }