Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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)
            {
            }
        }
Exemplo n.º 3
0
        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());
        }