Ejemplo n.º 1
0
        public void GetNextGameStateGivenRoundWinnerTest()
        {
            var testData = new List <Tuple <GameState, Deck, GameState> >()
            {
                new Tuple <GameState, Deck, GameState>(
                    new GameState(new List <Deck>()
                {
                    new Deck("Player 1", new List <int>()
                    {
                        9, 2, 6, 3, 1
                    }),
                    new Deck("Player 2", new List <int>()
                    {
                        5, 8, 4, 7, 10
                    })
                }, false),
                    new Deck("Player 2", new List <int>()
                {
                }),
                    new GameState(new List <Deck>()
                {
                    new Deck("Player 1", new List <int>()
                    {
                        2, 6, 3, 1
                    }),
                    new Deck("Player 2", new List <int>()
                    {
                        8, 4, 7, 10, 5, 9
                    })
                }, false)),
                new Tuple <GameState, Deck, GameState>(
                    new GameState(new List <Deck>()
                {
                    new Deck("Player 1", new List <int>()
                    {
                        9, 2, 6, 3, 1
                    }),
                    new Deck("Player 2", new List <int>()
                    {
                        5, 8, 4, 7, 10
                    })
                }, false),
                    new Deck("Player 1", new List <int>()
                {
                }),
                    new GameState(new List <Deck>()
                {
                    new Deck("Player 1", new List <int>()
                    {
                        2, 6, 3, 1, 9, 5
                    }),
                    new Deck("Player 2", new List <int>()
                    {
                        8, 4, 7, 10
                    })
                }, false)),
                new Tuple <GameState, Deck, GameState>(
                    new GameState(new List <Deck>()
                {
                    new Deck("Player 1", new List <int>()
                    {
                    }),
                    new Deck("Player 2", new List <int>()
                    {
                        3, 2, 10, 6, 8, 5, 9, 4, 7, 1
                    })
                }, false),
                    new Deck("Player 1", new List <int>()
                {
                }),
                    new GameState(new List <Deck>()
                {
                    new Deck("Player 1", new List <int>()
                    {
                    }),
                    new Deck("Player 2", new List <int>()
                    {
                        3, 2, 10, 6, 8, 5, 9, 4, 7, 1
                    })
                }, false)),
                new Tuple <GameState, Deck, GameState>(
                    new GameState(new List <Deck>()
                {
                    new Deck("Player 1", new List <int>()
                    {
                    }),
                    new Deck("Player 2", new List <int>()
                    {
                        3, 2, 10, 6, 8, 5, 9, 4, 7, 1
                    })
                }, false),
                    new Deck("Player 2", new List <int>()
                {
                }),
                    new GameState(new List <Deck>()
                {
                    new Deck("Player 1", new List <int>()
                    {
                    }),
                    new Deck("Player 2", new List <int>()
                    {
                        3, 2, 10, 6, 8, 5, 9, 4, 7, 1
                    })
                }, false))
            };

            foreach (var testExample in testData)
            {
                var actual = CombatHelper.GetNextGameStateGivenSubgameWinner(testExample.Item1, testExample.Item2);
                Assert.Equal(testExample.Item3, actual);
            }
        }