Ejemplo n.º 1
0
 private static IInputListener[] GenerateInputListeners(
     TextBox textBox, GameFlowFacade gameFlow, InputReactionCallbacks inputReactionCallbacks)
 {
     return(new IInputListener[]
     {
         new InputController(textBox, gameFlow, inputReactionCallbacks),
         textBox
     });
 }
Ejemplo n.º 2
0
        public void GenerateNewGame_HasFactoryMethod_FactoryMethodUsed()
        {
            var factoryMethodCalled = false;

            IHandlePlayerInteraction FactoryMethodMock()
            {
                factoryMethodCalled = true;
                return(_interactionHandlerMock.Object);
            }

            var sut = new GameFlowFacade(_boardViewUpdaterMock.Object, FactoryMethodMock);

            sut.GenerateNewGame();

            factoryMethodCalled.Should().BeTrue();
            _boardViewUpdaterMock.Verify(u => u.ResetGame());
        }
Ejemplo n.º 3
0
 public GameFlowFacadeTests()
 {
     _sut = new GameFlowFacade(_boardViewUpdaterMock.Object, () => _interactionHandlerMock.Object);
 }
Ejemplo n.º 4
0
 public InputController(TextBox textBox, GameFlowFacade gameFlow, InputReactionCallbacks inputReactionCallbacks)
 {
     _textBox  = textBox;
     _gameFlow = gameFlow;
     _inputReactionCallbacks = inputReactionCallbacks;
 }