public void TestSingleGameProjection()
 {
     var game = new NFLGame( "2015:01-A" );
      var ppg = new PlayerProjectionGenerator(null);
      ppg.Execute( game );
      Assert.IsTrue(  ppg != null );
 }
        public override string DoJob()
        {
            StartRun();
            var ppg = new PlayerProjectionGenerator( playerCache: null );
            var gameList = new ArrayList();

             //  do any unplayed games
             Logger.Debug( "   Doing whole season" );
            var s = new NflSeason( TimeKeeper.Season, loadGames: true, loadDivisions: false ); //  long time to load
            foreach ( var game in s.GameList )
                if (! game.Played() )
               gameList.Add( game );

            var nGames = 0;
            foreach ( var game in gameList.Cast<NFLGame>() )
            {
                ppg.Execute( game );
                nGames++;
            }
            //  records will be in the PGMETRIC table

            StopRun();

            var finishedMessage = string.Format( "Generated projections for {0} games", nGames );
            Logger.Info( "  {0}", finishedMessage );
            return finishedMessage;
        }
 public GeneratePlayerProjectionsJob( IKeepTheTime timeKeeper )
 {
     Name = "Generate Player Projections";
     TimeKeeper = timeKeeper;
     Logger = LogManager.GetCurrentClassLogger();
     IsNflRelated = true;
     Report = new PlayerProjectionGenerator( playerCache: null ) {Name = Name};
      SeasonScheduler = new SeasonScheduler();
 }
 public void TestProjectionOneGame()
 {
     var g = new NFLGame("2015:01-C");
     var sut = new PlayerProjectionGenerator(null);
     sut.Execute(g);
     Assert.IsNotNull(sut);
 }
 public void TestWeeklyProjection()
 {
     var w = new NFLWeek( "2014", "06" );
     var sut = new PlayerProjectionGenerator(null);
     var nGames = 0;
     for ( var i = 0; i < w.GameList().Count; i++ )
     {
         var game = (NFLGame) w.GameList()[ i ];
         sut.Execute( game );
         nGames++;
     }
     Assert.IsTrue( nGames > 10 && nGames < 17 );
 }