Exemplo n.º 1
0
        public void TestGetIteratedDominantStrategy()
        {
            var testSubject = new PayoffMatrix(playerA, playerB);
            var testControl = testSubject.Items;

            Assert.IsNotNull(testControl);
            Assert.AreNotEqual(0, testControl.Count);
            testSubject.GetIteratedDominantStrategy(true);

            var testResult = testSubject.Items;

            Assert.IsNotNull(testResult);
            Assert.AreNotEqual(0, testResult.Count);
            Assert.AreNotEqual(testControl.Count, testResult.Count);
        }
Exemplo n.º 2
0
        public void TestDangerousGame()
        {
            var testSubject = new PayoffMatrix(
                playerA, new[] { "A", "B" }, "Reader",
                playerB, new[] { "A", "B" }, "Author");

            Console.WriteLine(testSubject);
            var playerAChooses = testSubject.GetPlayerChoices(true);

            Assert.IsNotNull(playerAChooses);
            foreach (var pac in playerAChooses)
            {
                Console.WriteLine(pac.ToString(true));
            }

            var playerBChooses = testSubject.GetPlayerChoices(false);

            Assert.IsNotNull(playerBChooses);
            foreach (var pab in playerBChooses)
            {
                Console.WriteLine(pab.ToString(false));
            }
        }
Exemplo n.º 3
0
        public void TestIt()
        {
            var testSubject = new PayoffMatrix(
                playerA, new[] { "Skating Rink", "Football Game" }, "Haley",
                playerB, new[] { "Skating Rink", "Football Game" }, "Marge");

            Console.WriteLine(testSubject);
            var playerAChooses = testSubject.GetPlayerChoices(true);

            Assert.IsNotNull(playerAChooses);
            foreach (var pac in playerAChooses)
            {
                Console.WriteLine(pac.ToString(true));
            }

            var playerBChooses = testSubject.GetPlayerChoices(false);

            Assert.IsNotNull(playerBChooses);
            foreach (var pab in playerBChooses)
            {
                Console.WriteLine(pab.ToString(false));
            }
        }