public void Setup()
 {
     _display = new Mock<IGameDisplay>();
     _board = new Mock<IBoard>();
     _successor = new Mock<PlayGameHandler>();
     _playGameWelcomeHandler = new PlayGameWelcomeHandler();
     _playGameWelcomeHandler.SetSuccessor(_successor.Object);
 }
예제 #2
0
        public override void Load()
        {
            Bind<IGameDisplay>().To<ConsoleGameDisplay>();
            Bind<IMoveStrategy>().To<RandomMoveStrategy>();
            Bind<IBoard>().To<Board>();

            Bind<PlayGameHandler>().ToMethod(x =>
            {
                var playGameWelcomeHandler = new PlayGameWelcomeHandler();
                var playGameMoveHandler = new PlayGameMoveHandler(new RandomMoveStrategy(), 1000);
                playGameWelcomeHandler.SetSuccessor(playGameMoveHandler);
                playGameMoveHandler.SetSuccessor(new PlayGameResultHandler());
                return playGameWelcomeHandler;
            });
        }