Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
GameOfLife.Tests CellTests
Namespace: GameOfLife.Tests
Assembly: GameOfLife.Tests (in GameOfLife.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The CellTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
CellTests | Initializes a new instance of the CellTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CellHasRightDrawAreaInGrid | ||
CellIsAliveAfterCallingRevice | ||
CellIsDeadAfterCallingKill | ||
CreateTestCell | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
LiveCellHasWhiteColor | ||
NewCellIsDeadAndHasTransparentWhiteColor | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test, CloseAfterFirstFrame] public void CellIsAliveAfterCallingRevice() { cell.Revive(); Assert.IsTrue(cell.IsAlive); }
[Test, CloseAfterFirstFrame] public void CellIsDeadAfterCallingKill() { cell.Revive(); cell.Kill(); Assert.IsFalse(cell.IsAlive); }
[Test, CloseAfterFirstFrame] public void NewCellIsDeadAndHasTransparentWhiteColor() { Assert.IsFalse(cell.IsAlive); Assert.AreEqual(Color.TransparentWhite, cell.Color); }
[Test, CloseAfterFirstFrame] public void LiveCellHasWhiteColor() { cell.Revive(); Assert.AreEqual(Color.White, cell.Color); }
[Test, CloseAfterFirstFrame] public void CellHasRightDrawAreaInGrid() { var expectedTopLeft = new Vector2D(.45f, .45f); var expectedSize = new Size(.05f); var expectedDrawArea = new Rectangle(expectedTopLeft, expectedSize); Assert.AreEqual(cell.DrawArea, expectedDrawArea); }
See Also