public void MoveDownTest() { // arrange const int expected = 1; var snakeElement = new SnakeElement(1, 0, DirectionOfMove.Down); // act snakeElement.Move(); // assert Assert.AreEqual(expected, snakeElement.DistanceFromTop); }
public void MoveLeftTest() { // arrange const int expected = 0; var snakeElement = new SnakeElement(1, 1, DirectionOfMove.Left); // act snakeElement.Move(); // assert Assert.AreEqual(expected, snakeElement.DistanceFromLeft); }
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 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 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 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); }