Esempio n. 1
0
        public void TestGetQualifierScore_ShouldReturnTwoPointsPerCorrectQualifier()
        {
            string oneCorrect = @"[info]
user = ""user1""
[stage-one]
winners = [ [ ""Somethingelse"", ""Brasil"",], ]
";
            string actualbet  = @"[info]
user = ""user1""
[stage-one]
winners = [ [ ""Brasil"", ""Mexico"",], ]
";
            var    user       = new Results(oneCorrect.ParseAsToml());
            var    actual     = new Results(actualbet.ParseAsToml());
            var    s          = new ScoringSystem(user, actual);

            s.GetQualifierScore().ShouldBe(ScoringSystem.Points.QualifyingTeam);

            string twoCorrect = @"[info]
user = ""user1""
[stage-one]
winners = [ [ ""Mexico"", ""Brasil"",], ]
";

            user = new Results(twoCorrect.ParseAsToml());
            s    = new ScoringSystem(user, actual);
            s.GetQualifierScore().ShouldBe(2 * ScoringSystem.Points.QualifyingTeam);
        }
Esempio n. 2
0
        public void TestGetQualifierScore_ShouldReturnFourPointsPerCorrectPlacement()
        {
            string oneCorrect      = @"[info]
user = ""user1""
[stage-one]
winners = [ [ ""Brasil"", ""Whatever"",], ]
";
            string actualbet       = @"[info]
user = ""user1""
[stage-one]
winners = [ [ ""Brasil"", ""Mexico"",], ]
";
            var    oneCorrectScore = ScoringSystem.Points.QualifyingTeam + ScoringSystem.Points.QualifyingPosition;
            var    user            = new Results(oneCorrect.ParseAsToml());
            var    actual          = new Results(actualbet.ParseAsToml());
            var    s = new ScoringSystem(user, actual);

            s.GetQualifierScore().ShouldBe(oneCorrectScore);

            string twoCorrect = @"[info]
user = ""user1""
[stage-one]
winners = [ [ ""Brasil"", ""Mexico"",], ]
";

            user = new Results(twoCorrect.ParseAsToml());
            s    = new ScoringSystem(user, actual);
            s.GetQualifierScore().ShouldBe(2 * oneCorrectScore);
        }
Esempio n. 3
0
        public void TestGetQualifierScore_ShouldNotReturnPoints_WhenActualResultsIsDash()
        {
            string actualbet = @"[info]
user = ""user1""
[stage-one]
winners = [ [ ""-"", ""-"",], ]
";
            var    actual    = new Results(actualbet.ParseAsToml());
            var    s         = new ScoringSystem(actual, actual);

            s.GetQualifierScore().ShouldBe(0);
        }
Esempio n. 4
0
        public void TestGetQualifierScore_ShoulNotdReturnPoints_WhenGroupIsIncomplete()
        {
            string oneCorrect = @"[info]
user = ""user1""
[stage-one]
winners = [ [ ""Brasil"", ""Whatever"",], ]
";
            string actualbet  = @"[info]
user = ""user1""
[stage-one]
winners = [ [ ""-"", ""-"",], ]
";
            var    user       = new Results(oneCorrect.ParseAsToml());
            var    actual     = new Results(actualbet.ParseAsToml());
            var    s          = new ScoringSystem(user, actual);

            s.GetQualifierScore().ShouldBe(0);
        }