public void GameServiceAlwaysReturnsStateOfBoardAfterPlay()
        {
            _gameResultToReturnFromResolver = new FakeGameResult();

            var classUnderTest = BuildUpClassUnderTest();

            var result = classUnderTest.PlayGame(new Move());

            Assert.That(result, Is.Not.Null);
        }
        public void WhenResultIsDrawConfiguresViewAsDraw()
        {
            _moveToReturnFromMoveGenerator = new Move();
            _gameResultToReturnFromResolver = new DrawnGame(string.Empty);

            var classUnderTest = BuildUpClassUnderTest();

            var result = classUnderTest.PlayGame(new Move());

            Assert.That(result.IsDraw, Is.True);
        }
        public void GameServicePassesMoveFromMoveGeneratorToGameResolver()
        {
            _moveToReturnFromMoveGenerator = new Move();
            _gameResultToReturnFromResolver = new FakeGameResult();

            var classUnderTest = BuildUpClassUnderTest();

            classUnderTest.PlayGame(new Move());

            Assert.That(_move2PassedToResolver, Is.SameAs(_moveToReturnFromMoveGenerator));
        }
 public GameBoardViewModel(GameResult gameResult)
 {
     if (gameResult is WinGame)
     {
         var winGame = gameResult as WinGame;
         WinnerMove = winGame.WinningMove;
         LosingMove = winGame.LosingMove;
         IsDraw = false;
     }
     if (gameResult is DrawnGame)
     {
         IsDraw = true;
     }
     if (gameResult != null)
         ResultText = gameResult.ResultSummary;
 }