public ApiTests() { IClientLogic logic = new LogicStub(); ILog log = new LogStub(); _controller = new ClientController(logic, log); _controller.Request = new HttpRequestMessage(); _controller.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration()); }
public void HaveVictoryAt() { Board board = new Board(5); board.PutStone(CellState.Black, 0, 2); board.PutStone(CellState.White, 1, 2); board.PutStone(CellState.White, 3, 2); Logic logic = new LogicStub(board, 5); Assert.IsFalse(logic.HaveVictoryAt(2, 2, CellState.White)); board.PutStone(CellState.White, 4, 2); Assert.IsFalse(logic.HaveVictoryAt(2, 2, CellState.White)); board.PutStone(CellState.White, 0, 2); Assert.IsFalse(logic.HaveVictoryAt(2, 2, CellState.White)); board.PutStone(CellState.White, 2, 2); Assert.IsTrue(logic.HaveVictoryAt(2, 2, CellState.White)); Assert.IsFalse(logic.HaveVictoryAt(2, 1, CellState.White)); Assert.IsFalse(logic.HaveVictoryAt(2, 2, CellState.Black)); }
public void GetOpponentColor() { Logic logic = new LogicStub(new Board(1), 2); Assert.AreEqual(CellState.Black, logic.GetOpponentColor(CellState.White)); Assert.AreEqual(CellState.White, logic.GetOpponentColor(CellState.Black)); }