public void ChangeDirectionThrowsArgumentOutOfRangeExceptionWhenInvalidEnumValueTest() { // arrange var snakeElement = new SnakeElement(1, 1, DirectionOfMove.Up); // act // assert Assert.Throws <ArgumentOutOfRangeException>(() => snakeElement.ChangeDirection((DirectionOfMove)100)); }
public void ChangeDirectionToUpValidConditionsTest() { // arrange const DirectionOfMove expected = DirectionOfMove.Up; var snakeElement = new SnakeElement(1, 1, DirectionOfMove.Right); // act snakeElement.ChangeDirection(expected); snakeElement.Move(); // assert Assert.AreEqual(expected, snakeElement.DirectionOfMove); }
public void ChangeDirectionToLeftWhenCurrentIsRightTest() { // arrange const DirectionOfMove expected = DirectionOfMove.Right; var snakeElement = new SnakeElement(1, 1, DirectionOfMove.Right); // act snakeElement.ChangeDirection(DirectionOfMove.Left); snakeElement.Move(); // assert Assert.AreEqual(expected, snakeElement.DirectionOfMove); }
public void ChangeDirectionToDownWhenCurrentIsUpTest() { // arrange const DirectionOfMove expected = DirectionOfMove.Up; var snakeElement = new SnakeElement(1, 1, DirectionOfMove.Up); // act snakeElement.ChangeDirection(DirectionOfMove.Down); snakeElement.Move(); // assert Assert.AreEqual(expected, snakeElement.DirectionOfMove); }
public void ChangeDirectionToDownValidConditionsTest() { // arrange const DirectionOfMove expected = DirectionOfMove.Down; var snakeElement = new SnakeElement(0, 0, DirectionOfMove.Left); // act snakeElement.ChangeDirection(expected); snakeElement.Move(); // assert Assert.AreEqual(expected, snakeElement.DirectionOfMove); }