Example #1
0
        public void TestRunnerForWebsite()
        {
            var cards1 = new List <string>();
            int n      = int.Parse(Console.ReadLine()); // the number of cards for player 1

            for (int i = 0; i < n; i++)
            {
                string cardp1 = Console.ReadLine(); // the n cards of player 1
                cards1.Add(cardp1);
            }

            var cards2 = new List <string>();
            int m      = int.Parse(Console.ReadLine()); // the number of cards for player 2

            for (int i = 0; i < m; i++)
            {
                string cardp2 = Console.ReadLine(); // the m cards of player 2
                cards2.Add(cardp2);
            }

            var game = new WarGame(cards1, cards2);

            var result = game.Play();

            Console.WriteLine(result);
        }
Example #2
0
        public void Play_()
        {
            var game = new WarGame(new List <string> {
                "AD", "KC", "QC"
            }, new List <string> {
                "KH", "QS", "JC"
            });
            var result = game.Play();

            Assert.That(result.ToString(), Is.EqualTo("1 3"));
        }