FloodFillerTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  Drench.Tests FloodFillerTests

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

public class FloodFillerTests

The FloodFillerTests type exposes the following members.

Constructors

  NameDescription
Public methodFloodFillerTests
Initializes a new instance of the FloodFillerTests class
Top
Methods

  NameDescription
Public methodSettingColorSetsColorAtPosition
Public methodSettingColorToSameColorLeavesItUnchanged
Public methodSettingColorWhenAllColorsAreTheSameChangesThemAll
Public methodSettingColorWhenBoardIsSplitChangesOnlyPart
Public methodSetUp
Top
Examples

[Test]
public void SettingColorSetsColorAtPosition()
{
    floodFiller.SetColor(1, 1, Color.Red);
    Assert.AreEqual(Color.Red, colors[1, 1]);
}
[Test]
public void SettingColorToSameColorLeavesItUnchanged()
{
    floodFiller.SetColor(1, 1, Color.Red);
    floodFiller.SetColor(1, 1, Color.Red);
    Assert.AreEqual(Color.Red, colors[1, 1]);
    Assert.AreEqual(0, floodFiller.ProcessedCount);
}
[Test]
public void SettingColorWhenAllColorsAreTheSameChangesThemAll()
{
    floodFiller.SetColor(1, 1, Color.Red);
    for (int x = 0; x < Width; x++)
        for (int y = 0; y < Height; y++)
            Assert.AreEqual(Color.Red, colors[x, y]);
    Assert.AreEqual(16, floodFiller.ProcessedCount);
}
[Test]
public void SettingColorWhenBoardIsSplitChangesOnlyPart()
{
    SetFirstThreeColumnsToBlue();
    floodFiller.SetColor(1, 1, Color.Red);
    AssertFirstThreeColumnsAreRed();
    AssertRestOfTheColumnsAreBlack();
    Assert.AreEqual(12, floodFiller.ProcessedCount);
}
See Also