Esempio n. 1
0
        private static int AnnounceResult(NFLGame game, NFLResult result, int suWins, ref int suLosses, ref int atsWins,
                                          ref int atsTies, ref int atsLosses)
        {
            Utility.Announce(game.ScoreOut());
            var su = game.EvaluatePrediction(result);

            Utility.Announce(su);
            if (su.IndexOf("WIN") > -1)
            {
                suWins++;
            }
            else
            {
                suLosses++;
            }

            var ats = game.EvaluatePredictionAts(result, game.Spread);

            if (ats.IndexOf("WIN") > -1)
            {
                atsWins++;
            }
            else if (ats.IndexOf("PUSH") > -1)
            {
                atsTies++;
            }
            else
            {
                atsLosses++;
            }
            Utility.Announce(ats);
            return(suWins);
        }
Esempio n. 2
0
        public void TestAtsResultTie()
        {
            var prediction = new NFLResult {
                HomeTeam = "IC", AwayTeam = "MV", AwayScore = 22, HomeScore = 21
            };
            var game      = new NFLGame("2012:02-E");           //  BR @ PE
            var atsResult = game.EvaluatePredictionAts(prediction, game.Spread);

            Assert.AreEqual("ATS:PUSH", atsResult);
        }