Skip to content

Commit dcf492c

Browse files
committed
Add one more test for IsInBounds
1 parent 8a335c5 commit dcf492c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

HexCore.Tests/HexGraph/Graph.Test.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,5 +230,17 @@ public void SetOneCellBlocked_ShouldBlockCell()
230230
graph.SetOneCellBlocked(new Coordinate3D(0, 0, 0), false);
231231
Assert.That(graph.IsCellBlocked(new Coordinate3D(0, 0, 0)), Is.False);
232232
}
233+
234+
[Test]
235+
public void IsInBounds_ShouldReturnTrueIfThePositionIsWithinTheGraphBounds()
236+
{
237+
var graph = GraphFactory.CreateRectangularGraph(3, 3, OffsetTypes.OddRowsRight, MovementTypesMock.Ground);
238+
var position = new Coordinate3D(0, -1, 1);
239+
240+
Assert.That(graph.IsInBounds(position), Is.True);
241+
242+
position = new Coordinate3D(-1, 2, -1);
243+
Assert.That(graph.IsInBounds(position), Is.False);
244+
}
233245
}
234246
}

0 commit comments

Comments
 (0)