Exemplo n.º 1
0
        public DefaultGameController(IUnitySnapBehavior viewModel,
                                     IGameTurnManager turnManager, ISlapjackGame game)
        {
            Check.NotNull(viewModel, "viewModel");
            Check.NotNull(turnManager, "turnManager");
            Check.NotNull(game, "game");

            m_turnManager = turnManager;
            ViewModel     = viewModel;
            CurrentGame   = game;

            m_renderQueue         = new Queue <GameObject>();
            m_playerDeckLocations = new Dictionary <ICardGamePlayer, GameObjectTransformModel>();
        }
        private static void SetupMocks(out IUnitySnapBehavior snapBehavior, out IGameTurnManager gameTurnManager,
                                       out ISlapjackGame game, out ICardDealerLogic cardDealerLogic)
        {
            snapBehavior = Substitute.For <IUnitySnapBehavior>();
            snapBehavior.TurnUpCard(Arg.Any <ICardObject>()).Returns(true);

            gameTurnManager = SetupTurnManagerMock();
            var player = gameTurnManager.PlayerTurnManager.PlayerTurns.First().AssociatedPlayer;

            game = Substitute.For <ISlapjackGame>();
            game.Players.Returns(new List <ICardGamePlayer>()
            {
                player
            });

            cardDealerLogic = Substitute.For <ICardDealerLogic>();
            cardDealerLogic.DealCards(Arg.Any <int>()).Returns(new List <ICardCollection>());
        }