Inheritance Hierarchy
Drench.Tests FloodFillerTests
Namespace: Drench.Tests
Assembly: Drench.Tests (in Drench.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The FloodFillerTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
FloodFillerTests | Initializes a new instance of the FloodFillerTests class |
Methods
Name | Description | |
---|---|---|
SettingColorSetsColorAtPosition | ||
SettingColorToSameColorLeavesItUnchanged | ||
SettingColorWhenAllColorsAreTheSameChangesThemAll | ||
SettingColorWhenBoardIsSplitChangesOnlyPart | ||
SetUp |
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