Namespace: Blocks
Assembly: Blocks (in Blocks.exe) Version: 1.1.1.0 (1.1.1)
Tests: Blocks.Tests.ControllerTests
3 unit tests call Blocks.Controller.MoveBlockRightIfPossible
Assembly: Blocks (in Blocks.exe) Version: 1.1.1.0 (1.1.1)
Syntax
Remarks
Examples
[Test, CloseAfterFirstFrame] public void CantMoveRightAtRightWall() { Assert.IsFalse(sounds.BlockCouldNotMove.IsAnyInstancePlaying); controller.FallingBlock = new Block(displayMode, content, new Vector2D(11, 1)); controller.MoveBlockRightIfPossible(); Assert.AreEqual(11, controller.FallingBlock.Left); Assert.IsTrue(sounds.BlockCouldNotMove.IsAnyInstancePlaying); }
[Test, CloseAfterFirstFrame] public void CanMoveRightElsewhere() { Assert.IsFalse(sounds.BlockMoved.IsAnyInstancePlaying); controller.FallingBlock = new Block(displayMode, content, new Vector2D(3, 1)); controller.MoveBlockRightIfPossible(); Assert.IsTrue(sounds.BlockMoved.IsAnyInstancePlaying); Assert.AreEqual(4, controller.FallingBlock.Left); }
[Test, CloseAfterFirstFrame] public void CurrentBlockBeingNullWillNotCrashMovement() { controller.FallingBlock = null; Assert.DoesNotThrow(controller.MoveBlockLeftIfPossible); Assert.DoesNotThrow(controller.MoveBlockRightIfPossible); Assert.DoesNotThrow(controller.RotateBlockAntiClockwiseIfPossible); }
See Also