コード例 #1
0
        public void TestGetStageOneMatchScore_ShouldReturnFullScore_WhenResultIsSame()
        {
            string full   = @"[info]
user = ""user1""
[stage-one]
results = [ [ ""h"", ""h"", ""h"", ""u"", ""b"", ""b"",], [ ""h"", ""u"", ""h"", ""b"", ""b"", ""h"",], ]
winners = [ [ ""Brasil"", ""Mexico"",], [ ""Spania"", ""Nederland"",], ]
";
            var    user   = new Results(full.ParseAsToml());
            var    actual = new Results(full.ParseAsToml());
            var    s      = new ScoringSystem(user, actual);

            s.GetStageOneMatchScore().ShouldBe(2 * 6 * ScoringSystem.Points.StageOneMatchOutcome);
        }
コード例 #2
0
        public void TestGetStageOneMatchScore_ShouldReturnZero_WhenAllResultIsDifferent()
        {
            string userbet   = @"[info]
user = ""user1""
[stage-one]
results = [ [ ""h"", ""h"", ""h"", ""u"", ""b"", ""b"",], [ ""h"", ""u"", ""h"", ""b"", ""b"", ""h"",], ]
winners = [ [ ""Brasil"", ""Mexico"",], [ ""Spania"", ""Nederland"",], ]
";
            string actualbet = @"[info]
user = ""user1""
[stage-one]
results = [ [ ""b"", ""b"", ""b"", ""b"", ""h"", ""h"",], [ ""b"", ""b"", ""b"", ""h"", ""h"", ""b"",], ]
winners = [ [ ""Brasil"", ""Mexico"",], [ ""Spania"", ""Nederland"",], ]
";
            var    user      = new Results(userbet.ParseAsToml());
            var    actual    = new Results(actualbet.ParseAsToml());
            var    s         = new ScoringSystem(user, actual);

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