public void EntityObstacleMovingTest_WhenMovingHorizontalAndHittingLeftSideOfScreen_Speed_XBecomesPositive() { // Arrange Level level = new Level(null, 200, 200); EntityObstacleMoving obstacle = new EntityObstacleMoving(0, 0, -1, 0); level.SpawnEntity(obstacle); // Act level.Update(1); // Arrange Assert.IsTrue(obstacle.Speed.X.IsPositive()); }
public void AddEntity_ShouldAddMovingObstacleEntity_WithNoDirection() { //Arrange Editor editor = new Editor(null); List <Entity> chosenEntities = new List <Entity>(); EntityObstacleMoving selectedEntity = new EntityObstacleMoving(20, 20, 0, 0); int playerCount = 0; TextBox messageTextEditor = new TextBox(); //Act editor.AddEntity(selectedEntity, ref chosenEntities, selectedEntity, ref playerCount); //Assert Assert.AreEqual(new EntityObstacleMoving(20, 20, 0, 0).Speed, chosenEntities[0].Speed); }
public void AddEntity_ShouldAddMovingObstacleEntity_WithFourParameters() { //Arange Editor editor = new Editor(null); List <Entity> choosenEntities = new List <Entity>(); EntityObstacleMoving selectedEntity = new EntityObstacleMoving(20, 20, 0, 5); int playerCount = 0; TextBox messageTextEditor = new TextBox(); //Act editor.AddEntity(selectedEntity, ref choosenEntities, selectedEntity, ref playerCount); //Assert Assert.AreEqual("EntityObstacleMoving", choosenEntities[0].ToString()); }
public void EntityObstacleMovingTest_WhenMovingVerticalAndHittingBottomSideOfScreen_Speed_YBecomesNegative() { // Arrange Level level = new Level(null, 200, 200); EntityObstacleMoving obstacle = new EntityObstacleMoving(0, 0, 0, 1); obstacle.Y2 = 199; level.SpawnEntity(obstacle); // Act level.Update(1); // Arrange Assert.IsTrue(obstacle.Speed.Y.IsNegative()); }
public void EntityObstacleMovingTest_WhenMovingVertical_YPositionChanges() { // Arrange Level level = new Level(null, 200, 200); EntityObstacleMoving obstacle = new EntityObstacleMoving(10, 10, 0, 1); level.SpawnEntity(obstacle); Vector StartPosition = obstacle.Position; // Act level.Update(1); // Assert Assert.AreNotEqual(StartPosition.Y, obstacle.Y1); }