public void TestGameOver() { var gameOv = new GameOverMessage(WinType.win, new Position[] { new Position(0, 0, 0), new Position(0, 0, 0), new Position(0, 0, 0) }); byte[] bytes = Encoding.UTF8.GetBytes(gameOv.MessageToString()); var gameOv2 = new GameOverMessage(WinType.win, new Position[] { new Position(0, 0, 0), new Position(0, 0, 0), new Position(0, 0, 0) }); Assert.AreEqual(gameOv.MessageToString(), gameOv2.MessageToString()); }
public void SendGameOver(WinType winType, Position[] winningSequence) { var gameOver = new GameOverMessage(winType, winningSequence); var data = Encoding.UTF8.GetBytes(gameOver.MessageToString()); try { stream.Write(data, 0, data.Length); } catch (System.IO.IOException e) { } }
public void TestGameOverToString() { var gameOv = new GameOverMessage(WinType.win, new Position[] { new Position(0, 0, 0), new Position(0, 0, 0), new Position(0, 0, 0) }); Assert.AreEqual($"OVER|{true.ToString()}", gameOv.MessageToString()); }