コード例 #1
0
        public void RunTest()
        {
            Competitor competitorA = new Competitor() { Name = "A", TheoreticalRating = 60 };
            Competitor competitorB = new Competitor() { Name = "B", TheoreticalRating = 50 };

            Match match = new Match(new NonRandomMs(), 1);
            match.Run(competitorA, competitorB);

            Assert.AreEqual(competitorA, match.Winner);
            Assert.AreEqual(competitorB, match.Loser);
        }
コード例 #2
0
        public void RunTest_SimpleRandomMatchStrategy()
        {
            Competitor competitorA = new Competitor() { Name = "A", TheoreticalRating = 60 };
            Competitor competitorB = new Competitor() { Name = "B", TheoreticalRating = 40 };

            Match match = new Match(new SimpleRandomMs(), 1);

            int wins = 0;
            for (int i = 0; i < 100; i++)
            {
                match.Run(competitorA, competitorB);
                if (match.Winner.Name == "A")
                    wins++;
            }
        }