Inheritance Hierarchy
Drench.Tests BoardTests
Namespace: Drench.Tests
Assembly: Drench.Tests (in Drench.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The BoardTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
BoardTests | Initializes a new instance of the BoardTests class |
Methods
Name | Description | |
---|---|---|
BoardTopLeftColor | ||
ChangingOriginalAfterCloningDoesntAffectClone | ||
CloneMatchesOriginal | ||
CreateBoard | ||
CreateBoardData | ||
CreateBoardFromData | ||
GetAndSetColor | ||
Randomize | ||
SetUp |
Fields
Name | Description | |
---|---|---|
BoardDataHeight | ||
BoardDataWidth |
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