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.MoveBlockLeftIfPossible
Assembly: Blocks (in Blocks.exe) Version: 1.1.1.0 (1.1.1)
Syntax
Remarks
Examples
[Test, CloseAfterFirstFrame] public void CantMoveLeftAtLeftWall() { Assert.IsFalse(sounds.BlockCouldNotMove.IsAnyInstancePlaying); controller.FallingBlock = new Block(displayMode, content, new Vector2D(0, 1)); controller.MoveBlockLeftIfPossible(); Assert.IsTrue(sounds.BlockCouldNotMove.IsAnyInstancePlaying); Assert.AreEqual(0, controller.FallingBlock.Left); }
[Test, CloseAfterFirstFrame] public void CanMoveLeftElsewhere() { Assert.IsFalse(sounds.BlockMoved.IsAnyInstancePlaying); controller.FallingBlock = new Block(displayMode, content, new Vector2D(3, 1)); controller.MoveBlockLeftIfPossible(); Assert.IsTrue(sounds.BlockMoved.IsAnyInstancePlaying); Assert.AreEqual(2, 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