public void Given_Arena_Is_10X3_Then_IsValidPosition_2X2_Return_True() { // ARRANGE var rec = new RectangleArena(); rec.SetArenaSize(10, 3); // ACT var result = rec.IsValidPosition(new Position(2 , 2, Orientation.East)); // ASSERT Assert.True(result); }
public void Given_ArenaSize_Is_5X5_Then_IsValidPosition_6X5_ReturnFalse() { // ARRANGE var rec = new RectangleArena(); rec.SetArenaSize(5, 5); // ACT var result = rec.IsValidPosition(new Position(6 , 5, Orientation.East)); // ASSERT Assert.False(result); }
public void Given_Valid_Command_Arena_Should_Accept_Valid_Position() { // ARRANGE var command = "3 3"; var arena = new RectangleArena(); // ACT new SetupArenaCommand(arena).Perform(command); // ASSERT Assert.True(arena.IsValidPosition(new Position(0, 0, Orientation.East))); Assert.True(arena.IsValidPosition(new Position(1, 0, Orientation.East))); Assert.True(arena.IsValidPosition(new Position(2, 0, Orientation.East))); Assert.True(arena.IsValidPosition(new Position(0, 1, Orientation.East))); Assert.True(arena.IsValidPosition(new Position(1, 1, Orientation.East))); Assert.True(arena.IsValidPosition(new Position(2, 1, Orientation.East))); }