public void TestDaoGetsRightWeek()
        {
            var sut     = new DbfPlayerGameMetricsDao();
            var pgmList = sut.GetWeek("2013", "02");

            Assert.IsTrue(pgmList.All(p => p.Week() == "02"));
        }
 public MetricsUpdateReport( IKeepTheTime timekeeper)
 {
     Name = "Metrics Update Report";
      Season = timekeeper.CurrentSeason();
       Week = new NFLWeek( Season, timekeeper.PreviousWeek());
     Scorer = new YahooScorer(Week);
     Dao = new DbfPlayerGameMetricsDao();
 }
        public void TestFileGetsOutput()
        {
            var dao    = new DbfPlayerGameMetricsDao();           //  Could use a Fake here
            var scorer = new YahooProjectionScorer();             //  Could use a Fake here
            var sut    = new FantasyProjectionReport("2013", "01", dao, scorer);

            sut.League = Constants.K_LEAGUE_Yahoo;
            sut.Render();
            Assert.IsTrue(File.Exists(sut.FileName()));
        }
        public void TestRenderTommysProjection()
        {
            var dao    = new DbfPlayerGameMetricsDao();           //  Could use a Fake here
            var scorer = new YahooProjectionScorer();             //  Could use a Fake here
            var sut    = new FantasyProjectionReport("2013", "4", dao, scorer);

            sut.League = Constants.K_LEAGUE_50_Dollar_Challenge;
            sut.RenderAll();
            Assert.IsTrue(File.Exists(sut.FileName()));
        }
        public void TestFileGetsOutputForSF()
        {
            var dao    = new DbfPlayerGameMetricsDao();           //  Could use a Fake here
            var scorer = new YahooProjectionScorer();             //  Could use a Fake here
            var sut    = new FantasyProjectionReport("2013", "01", dao, scorer);

            sut.TeamFilter     = "SF";
            sut.CategoryFilter = "3";
            sut.Render();
            Assert.IsTrue(File.Exists(sut.FileName()));
        }
        public void TestASavingMetrics()
        {
            var msg = new PlayerGameProjectionMessage();

            msg.Game = new NFLGame("2013:01-B");
            var sut     = new GetGamePrediction(msg);
            var sut2    = new PullMetricsFromPrediction(msg);
            var sut3    = new SavePlayerGameMetrics(msg);
            var dpgmDoa = new DbfPlayerGameMetricsDao();
            List <PlayerGameMetrics> pgmList = msg.Game.PlayerGameMetrics;
            var expectedPgm = pgmList.FirstOrDefault();
            var pgm         = dpgmDoa.Get(expectedPgm.PlayerId, expectedPgm.GameKey);

            Assert.IsNotNull(pgm);
        }