public void TestLoadPreviousSeasonGmes()
 {
     var team = new NflTeam("SF");
     team.LoadPreviousRegularSeasonGames(team.TeamCode, "2014", new DateTime(2014, 9, 7));
     Assert.IsTrue(team.GameList.Count.Equals(16));
     var game1 = (NFLGame) team.GameList[15];
     Assert.IsTrue(game1.Season.Equals("2013"));
 }
Exemple #2
0
 public static int OffRating(NflTeam team, DateTime predictionDate)
 {
     team.LoadPreviousRegularSeasonGames(4, predictionDate);
      var offArray = new int[4];
      var i = 0;
      foreach (NFLGame game in team.GameList)
      {
     offArray[i] = game.ScoreFor(team.TeamCode);
     i++;
      }
      Array.Sort(offArray);
      var tot = offArray[1] + offArray[2];
      return tot / 2;
 }
Exemple #3
0
        public static int DefRating(NflTeam team, DateTime predictionDate)
        {
            team.LoadPreviousRegularSeasonGames(4, predictionDate);
             var defArray = new int[4];
             var i = 0;

             foreach (NFLGame game in team.GameList)
             {
            defArray[i] = game.AgainstFor(team.TeamCode);
            i++;
             }
             Array.Sort(defArray);
             int tot = defArray[1] + defArray[2];
             return tot / 2;
        }
 public void TallyTeam( ICollection<NflTeam> teamList, string season, DateTime focusDate, string teamCode )
 {
     var team = new NflTeam( teamCode );  //  simple code constructor
     if ( thisSeasonOnly )
         team.LoadGames( team.TeamCode, season );
     else
         team.LoadPreviousRegularSeasonGames( team.TeamCode, season, focusDate );
     team.TallyStats();
     teamList.Add( team );
 }