예제 #1
0
        public void TeamCountsFourRunnersThreeTeams()
        {
            TestRunners = LoadFourRunnersFromThreeTeams();
            RaceField Field = new RaceField(string.Empty, 5, 7);

            TestRunners.ForEach(x => Field.AddRunner(x));
            int oneRunner  = 0;
            int twoRunners = 0;

            foreach (var fieldTeamCount in Field.TeamCounts)
            {
                if (fieldTeamCount.Value == 1)
                {
                    oneRunner++;
                }

                if (fieldTeamCount.Value == 2)
                {
                    twoRunners++;
                }
            }
            Assert.AreEqual(3, Field.TeamCounts.Count);
            Assert.AreEqual(1, twoRunners);
            Assert.AreEqual(2, oneRunner);
        }
예제 #2
0
        public void TeamWithTooFewDontCountTwpRunners()
        {
            TestRunners = LoadSixRunnersFromFourTeams();
            RaceField Field = new RaceField(string.Empty, 2, 7);

            TestRunners.ForEach(x => Field.AddRunner(x));
            Field.AssignPoints();
            Runner lastRunner = Field.Runners[5];

            Assert.AreEqual(4, lastRunner.Points);
            Assert.AreEqual(6, lastRunner.Place);
        }
예제 #3
0
        public void TeamWithTooFewDontCountOneRunner()
        {
            TestRunners = LoadFiveRunnersFromThreeTeams();
            RaceField Field = new RaceField(string.Empty, 2, 7);

            TestRunners.ForEach(x => Field.AddRunner(x));
            Field.AssignPoints();
            Runner lastRunner = Field.Runners[4];

            Assert.AreEqual(4, lastRunner.Points);
            Assert.AreEqual(5, lastRunner.Place);
        }
예제 #4
0
        public void TeamCountsFourRunnersFourTeams()
        {
            TestRunners = LoadFourRunnersFromFourTeams();
            RaceField Field = new RaceField(string.Empty, 5, 7);

            TestRunners.ForEach(x => Field.AddRunner(x));
            Assert.AreEqual(4, Field.TeamCounts.Count);
            foreach (var fieldTeamCount in Field.TeamCounts)
            {
                Assert.AreEqual(1, fieldTeamCount.Value);
            }
        }