Exemplo n.º 1
0
        public void MakeMoveTest()
        {
            var session = FakeContext.FakeHttpContext(
                new Dictionary<string, object> {
                    { "boardStatus", 0 },
                    { "boardMoves", new List<int> { 0, 0, 0, 0, 0, 0, 0, 0, 0} }
                }, "http://localhost:65516/api/").Session;
            BoardService servise = new BoardService(session);
            var cellNumber = 2;
            servise.MakeMove(cellNumber, Marks.X);

            Assert.AreEqual(1, servise.BoardValues.Where(x=>x==1).Count());
            Assert.AreEqual((int)Marks.X, servise.BoardValues.ElementAt(cellNumber));
        }