public void ProceedWithOffPolicy(View.Render sut, IAlternateMethodContext context)
        {
            context.Setup(c => c.RuntimePolicyStrategy).Returns(() => RuntimePolicy.Off);

            sut.NewImplementation(context);

            context.Verify(c => c.Proceed());
            context.TimerStrategy().Verify(t => t.Time(It.IsAny <Action>()), Times.Never());
        }
        public void PublishMessagesWithOnPolicy(View.Render sut, IAlternateMethodContext context, IViewCorrelationMixin mixin, ViewContext viewContext)
        {
            context.Setup(c => c.Arguments).Returns(new object[] { viewContext, new StringWriter() });
            context.Setup(c => c.Proxy).Returns(mixin);

            sut.NewImplementation(context);

            context.TimerStrategy().Verify(t => t.Time(It.IsAny <Action>()));
            context.MessageBroker.Verify(b => b.Publish(It.IsAny <View.Render.Message>()));
        }
예제 #3
0
        static public void start()
        {
            while ((!playerInitializer()))
            {
                ;
            }
            board    = new Model.Board();
            render   = new View.Render();
            makeTurn = new Controller.MakeTurn();
            render.show(board.getCells());
            bool isWhite = false;

            int[,] values = new int[2, 2];
            bool falseMove = false;

            validator = new Controller.Validator();
            while (true)
            {
                isWhite   = !isWhite;
                falseMove = !falseMove;
                //Отрисовка имени игрока под доской
                if (isWhite)
                {
                    render.writeCurrentUserLine(player1);
                }
                else
                {
                    render.writeCurrentUserLine(player2);
                }

                //Пока не будет введен корректный ход
                while (falseMove)
                {
                    //Проверка символьной правильности введенного хода
                    values = makeTurn.moveChecker(isWhite);
                    //
                    if (validator.check(board.getCells(), ref values, isWhite))
                    {
                        falseMove = false;
                    }
                }
                board.setCells(values);
                render.show(board.getCells());
            }
        }
        public void SetProperties()
        {
            var sut = new View.Render();

            Assert.NotNull(sut.MethodToImplement);
        }
예제 #5
0
        public void SetProperties()
        {
            var sut = new View.Render();

            Assert.NotNull(sut.MethodToImplement);
        }