public void TestIsWonInTopHorizonalPositionForX() { // 1. Arrange: Logic logic = new Logic(); // 2. Act: logic.matrix[0][0] = "X"; logic.matrix[0][1] = "X"; logic.matrix[0][2] = "X"; // 3. Assert: Assert.IsTrue(logic.IsWon()); }
public void TestIsWonInRightVerticalPositionForO() { // 1. Arrange: Logic logic = new Logic(); // 2. Act: logic.matrix[2][0] = "O"; logic.matrix[2][1] = "O"; logic.matrix[2][2] = "O"; //3. Assert: Assert.IsTrue(logic.IsWon()); }
public void TestIsWonInDiagonalPositionForXTopLeftToBottomRight() { // 1. Arrange: Logic logic = new Logic(); // 2. Act: logic.matrix[0][0] = "X"; logic.matrix[1][1] = "X"; logic.matrix[2][2] = "X"; //3. Assert: Assert.IsTrue(logic.IsWon()); }
public void TestIsWonInLeftVerticalPositionForX() { // 1. Arrange: Logic logic = new Logic(); // 2. Act: logic.matrix[0][0] = "X"; logic.matrix[1][0] = "X"; logic.matrix[2][0] = "X"; //3. Assert: Assert.IsTrue(logic.IsWon()); }
public void TestIsWonForRandomGameWhereThereIsATie() { // 1. Arrange: Logic logic = new Logic(); // 2. Act: logic.matrix[0][0] = "X"; logic.matrix[0][1] = "O"; logic.matrix[0][2] = "X"; logic.matrix[1][0] = "X"; logic.matrix[1][1] = "O"; logic.matrix[1][2] = "X"; logic.matrix[2][0] = "O"; logic.matrix[2][1] = "X"; logic.matrix[2][2] = "O"; // 3. Assert: Assert.IsFalse(logic.IsWon()); }