private void TestCanHandleLine(TestLine line) { Mark startMark = Mark.AIFromCoordinates(line.RowStart, line.ColumnStart); Mark endMark = Mark.AIFromCoordinates(line.RowEnd, line.ColumnEnd); var initialBoard = BoardTestHelper.GetABoardWithMarks(new List<Mark> { startMark, endMark }); var cellValue = line.EvaluateValue == "AI" ? AI_MARK : ' '; initialBoard.FillCell(new CellCoordinates(line.RowEvaluate, line.ColumnEvaluate), cellValue); var canHandle = winStrategy.CanHandle(initialBoard, AI_MARK); canHandle.Should().Be(line.ExpectedCanHandleValue); }
public void TestUpdate_ForDiagonals(TestLine line) { TestUpdateLine(line); }
public void TestUpdate_ForRows(TestLine line) { TestUpdateLine(line); }
public void TestUpdate_ForColumns(TestLine line) { TestUpdateLine(line); }
public void TestCanHandle_ForRows(TestLine line) { TestCanHandleLine(line); }
public void TestCanHandle_ForDiagonals(TestLine line) { TestCanHandleLine(line); }
public void TestCanHandle_ForColumns(TestLine line) { TestCanHandleLine(line); }
private void TestUpdateLine(TestLine line) { Mark startMark = Mark.AIFromCoordinates(line.RowStart, line.ColumnStart); Mark endMark = Mark.AIFromCoordinates(line.RowEnd, line.ColumnEnd); var initialBoard = BoardTestHelper.GetABoardWithMarks(new List<Mark> { startMark, endMark }); if (line.ExpectedCanHandleValue) { winStrategy.Update(initialBoard, AI_MARK); initialBoard.IsCellOfType(AI_MARK, new CellCoordinates(line.RowEvaluate, line.ColumnEvaluate)); } }