public void TestNibbleRatingsServiceNiners2011B()
        {
            var nrs = new NibbleRatingsService {
                WeeksToGoBack = 17
            };
            var sf = new NflTeam("SF");
            var nr = nrs.GetNibbleRatingFor(sf, new DateTime(2010, 8, 17));

            Assert.IsTrue(nr.Defence.Equals(-13),
                          string.Format("Off Rating should be -13 not {0}", nr.Defence));
        }
        public void TestNibbleRatingforGreenBay()
        {
            var rs = new NibbleRatingsService {
                AuditIt = true, WeeksToGoBack = 1
            };
            var team     = new NflTeam("GB");
            var gbRating = rs.GetNibbleRatingFor(team, Utility.StartOfSeason("2011"));

            Assert.IsTrue(gbRating.Offence.Equals(-2), string.Format("Offence should be -2 not {0}",
                                                                     gbRating.Offence));
            Assert.IsTrue(gbRating.Defence.Equals(-4), string.Format("Defence should be -4 not {0}",
                                                                     gbRating.Defence));
        }
        public void TestNibblePredictor()
        {
            var rs = new NibbleRatingsService {
                AuditIt = true, WeeksToGoBack = 1
            };
            var np = new NibblePredictor {
                RatingsService = rs, AuditTrail = true
            };
            var game   = new NFLGame("2011:01-A");            //  NO @ GB
            var result = np.PredictGame(game, new FakePredictionStorer(), Utility.StartOfSeason());

            Assert.IsTrue(result.HomeWin());
            Assert.IsTrue(result.HomeScore.Equals(23), string.Format("Home score should be 23 not {0}", result.HomeScore));
            Assert.IsTrue(result.AwayScore.Equals(17), string.Format("Away score should be 17 not {0}", result.AwayScore));
        }
        public void TestNibblePredictionsFor2012()
        {
            const string season  = "2012";
            var          fileout = string.Format("{0}\\{1}\\Projections\\Nibble.htm",
                                                 Utility.OutputDirectory(), season);
            var rs = new NibbleRatingsService {
                AuditIt = true, WeeksToGoBack = 17
            };
            var ps = new DbfPredictionStorer();
            var np = new NibblePredictor
            {
                RatingsService   = rs,
                AuditTrail       = false,
                StorePrediction  = true,
                PredictionStorer = ps
            };

            np.PredictSeason(season, Utility.StartOfSeason(season), fileout);
            Assert.IsTrue(File.Exists(fileout), string.Format("Cannot find {0}", fileout));
        }