CellTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  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

public class CellTests : TestWithMocksOrVisually

The CellTests type exposes the following members.

Constructors

  NameDescription
Public methodCellTests
Initializes a new instance of the CellTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodCellHasRightDrawAreaInGrid
Public methodCellIsAliveAfterCallingRevice
Public methodCellIsDeadAfterCallingKill
Public methodCreateTestCell
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Public methodLiveCellHasWhiteColor
Public methodNewCellIsDeadAndHasTransparentWhiteColor
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
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