BoardTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  Drench.Tests BoardTests

Namespace: Drench.Tests
Assembly: Drench.Tests (in Drench.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class BoardTests

The BoardTests type exposes the following members.

Constructors

  NameDescription
Public methodBoardTests
Initializes a new instance of the BoardTests class
Top
Methods

  NameDescription
Public methodBoardTopLeftColor
Public methodChangingOriginalAfterCloningDoesntAffectClone
Public methodCloneMatchesOriginal
Public methodCreateBoard
Public methodStatic memberCreateBoardData
Public methodCreateBoardFromData
Public methodGetAndSetColor
Public methodRandomize
Public methodSetUp
Top
Fields

  NameDescription
Public fieldStatic memberBoardDataHeight
Public fieldStatic memberBoardDataWidth
Top
Examples

[Test]
public void CreateBoard()
{
    Assert.AreEqual(Width, board.Width);
    Assert.AreEqual(Height, board.Height);
}
[Test]
public void BoardTopLeftColor()
{
    Assert.AreEqual(new Color(0.5f, 1.0f, 1.0f), board.GetColor(0, 0));
}
[Test]
public void Randomize()
{
    board.Randomize();
    Assert.AreEqual(new Color(1.0f, 1.0f, 0.5f), board.GetColor(0, 0));
}
[Test]
public void GetAndSetColor()
{
    board.SetColor(0, 0, Color.Red);
    board.SetColor(Vector2D.One, Color.Green);
    Assert.AreEqual(Color.Red, board.GetColor(0, 0));
    Assert.AreEqual(Color.Green, board.GetColor(Vector2D.One));
}
[Test]
public void CloneMatchesOriginal()
{
    board.SetColor(0, 0, Color.Red);
    Board clone = board.Clone();
    Assert.AreEqual(Color.Red, clone.GetColor(0, 0));
}
[Test]
public void ChangingOriginalAfterCloningDoesntAffectClone()
{
    Board clone = board.Clone();
    board.SetColor(0, 0, Color.Red);
    Assert.AreNotEqual(Color.Red, clone.GetColor(0, 0));
}
[Test]
public void CreateBoardFromData()
{
    board = new Board(CreateBoardData());
    Assert.AreEqual(board.Width, 2);
    Assert.AreEqual(board.Height, 3);
    Assert.AreEqual(board.GetColor(0, 1), Color.Red);
    Assert.AreEqual(board.GetColor(1, 2), Color.Orange);
}
See Also