public void ProcessSpaceInputTest() { Spaceship spaceship = new Spaceship(); InputManager input = new InputManager(); PrivateObject privateInput = new PrivateObject(input); privateInput.SetField("currentState", new KeyboardState(Keys.Space)); SpaceshipController controller = new SpaceshipController(spaceship, input); controller.ProcessInput(); Assert.IsTrue(spaceship.BeamOn); }
public void RightInputTest() { Spaceship spaceship = new Spaceship(); InputManager input = new InputManager(); PrivateObject privateInput = new PrivateObject(input); privateInput.SetField("currentState", new KeyboardState(Keys.D)); SpaceshipController controller = new SpaceshipController(spaceship, input); spaceship.X = 0; controller.ProcessInput(); Assert.AreEqual(0 + spaceship.Speed, spaceship.X); }