public void GetCellForPos_Should_Return_MazeWall_For_Anything_Else() { IMazeCellFactory factoryTested = new DayTwentyMazeFactory(); int x = 3; int y = 1; StringBuilder mazeDef = new StringBuilder(); mazeDef.AppendLine(" "); mazeDef.AppendLine(" B "); mazeDef.AppendLine(" "); MazeCell cell = factoryTested.GetCellForPos(x, y, mazeDef.ToString().ToDoubleCharArray()); cell.Should().BeOfType <MazeWall>(); cell.X.Should().Be(x); cell.Y.Should().Be(y); }
public void GetCellForPos_Should_Return_MazeExit_For_Dot_Next_To_ZZ_After() { IMazeCellFactory factoryTested = new DayTwentyMazeFactory(); int x = 3; int y = 2; StringBuilder mazeDef = new StringBuilder(); mazeDef.AppendLine(" "); mazeDef.AppendLine(" "); mazeDef.AppendLine(" .ZZ"); mazeDef.AppendLine(" "); MazeCell cell = factoryTested.GetCellForPos(x, y, mazeDef.ToString().ToDoubleCharArray()); cell.Should().BeOfType <MazeExit>(); cell.X.Should().Be(x); cell.Y.Should().Be(y); }
public void GetCellForPos_Should_Return_MazePortal_For_Dot_Next_To_Horizontal_Double_Upper_Case_Letters_Before() { IMazeCellFactory factoryTested = new DayTwentyMazeFactory(); int x = 3; int y = 1; StringBuilder mazeDef = new StringBuilder(); mazeDef.AppendLine(" "); mazeDef.AppendLine(" BC. "); mazeDef.AppendLine(" "); mazeDef.AppendLine(" "); MazeCell cell = factoryTested.GetCellForPos(x, y, mazeDef.ToString().ToDoubleCharArray()); cell.Should().BeOfType <MazePortal>(); cell.X.Should().Be(x); cell.Y.Should().Be(y); (cell as MazePortal).Id.Should().Be("BC"); }