Namespace: Blocks
Assembly: Blocks (in Blocks.exe) Version: 1.1.1.0 (1.1.1)
Tests: Blocks.Tests.GameTests
13 unit tests call Blocks.Game.Controller
Assembly: Blocks (in Blocks.exe) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: ControllerRemarks
Examples
[Test, CloseAfterFirstFrame] public void CursorLeftMovesBlockLeft() { game.StartGame(); InitializeBlocks(game.Controller, content); mockKeyboard.SetKeyboardState(Key.CursorLeft, State.Pressing); AdvanceTimeAndUpdateEntities(0.01f); if (IsMockResolver) //ncrunch: no coverage start return; Assert.AreEqual(4, game.Controller.FallingBlock.Left); //ncrunch: no coverage end }
[Test, CloseAfterFirstFrame] public void HoldingCursorLeftEventuallyMovesBlockLeftTwice() { game.StartGame(); InitializeBlocks(game.Controller, content); mockKeyboard.SetKeyboardState(Key.CursorLeft, State.Pressing); AdvanceTimeAndUpdateEntities(0.01f); if (IsMockResolver) //ncrunch: no coverage start return; Assert.AreEqual(4, game.Controller.FallingBlock.Left); AdvanceTimeAndUpdateEntities(0.02f); Assert.AreEqual(3, game.Controller.FallingBlock.Left); //ncrunch: no coverage end }
[Test, CloseAfterFirstFrame] public void CursorRightMovesBlockRight() { game.StartGame(); InitializeBlocks(game.Controller, content); mockKeyboard.SetKeyboardState(Key.CursorRight, State.Pressing); AdvanceTimeAndUpdateEntities(0.01f); if (IsMockResolver) //ncrunch: no coverage start return; Assert.AreEqual(8, game.Controller.FallingBlock.Left); //ncrunch: no coverage end }
See Also