public void TestYahooProjectedPointsFrTomBrady2013Week01()
 {
     var p = new NFLPlayer( "BRADTO01" );
      var g = new NFLGame( "2013:01-B" );
      g.LoadPrediction();
      var c = new YahooCalculator();
      var msg = c.Calculate( p, g );
      var expected = 18;  //  2 TDp and 250 YDp
      Assert.AreEqual( expected, msg.Player.Points );
 }
 public void TestYahooProjectedPointsForSammyWatkinsWeek16()
 {
     var p = new NFLPlayer( "WATKSA01" );
      var g = new NFLGame( "2014:16-M" );
      g.LoadPrediction();
      var c = new YahooCalculator();
      var msg = c.Calculate( p, g );
      var expected = 13;  //  1 TDp and 75 YDc
      Assert.AreEqual( expected, msg.Player.Points );
 }
 public void TestYahooProjectedPointsForPeytonManning2014Week01()
 {
     var p = new NFLPlayer( "NEWTCA01" );
      var g = new NFLGame( "2015:08-N" );
      g.LoadPrediction();
      var c = new YahooCalculator();
      var msg = c.Calculate( p, g );
      var expected = 6;  //  0 TDp and 150 YDp
      Assert.AreEqual( expected, msg.Player.Points );
 }
 public void TestYahooProjectedPointsForLataviusMurray2016Week01()
 {
     var p = new NFLPlayer( "MURRLA01" );
      var g = new NFLGame( "2016:01-F" );
      g.LoadPrediction();
      var c = new YahooCalculator();
      var msg = c.Calculate( p, g );
      var expected = 18;  //  125(1)
      Assert.AreEqual( expected, msg.Player.Points );
 }
Пример #5
0
        private DataTable BuildTable()
        {
            var c    = new YahooCalculator();
            var dt   = new DataTable();
            var cols = dt.Columns;

            cols.Add("WEEK", typeof(String));
            cols.Add("MATCH", typeof(String));
            cols.Add("SCORE", typeof(String));
            cols.Add("OPPRATE", typeof(String));
            cols.Add("PROJ", typeof(Int16));
            cols.Add("FP", typeof(Decimal));
            cols.Add("STATS", typeof(String));
            cols.Add("ACTUAL", typeof(Int16));
            cols.Add("VAR", typeof(Int16));

            int  gameCount = 1;
            bool byeDone   = false;

            foreach (var g in Player.CurrentGames)
            {
                var dr = dt.NewRow();
                g.LoadPrediction("unit");
                if ((g.WeekNo > gameCount) && (!byeDone))
                {
                    dr["WEEK"]    = gameCount;
                    dr["MATCH"]   = "BYE";
                    dr["SCORE"]   = "";
                    dr["OPPRATE"] = "";
                    dr["PROJ"]    = 0;
                    dr["FP"]      = 0;
                    dr["STATS"]   = "";
                    dr["ACTUAL"]  = 0;
                    dr["VAR"]     = 0;
                    dt.Rows.Add(dr);
                    dr      = dt.NewRow();
                    byeDone = true;
                }
                dr["WEEK"]    = g.WeekNo;
                dr["MATCH"]   = g.OpponentOut(Player.CurrTeam.TeamCode);
                dr["SCORE"]   = g.ProjectedScoreOut(Player.CurrTeam.TeamCode);
                dr["OPPRATE"] = OppUnitRating(g, Player.CurrTeam.TeamCode, Player.PlayerCat);
                dr["PROJ"]    = GameProjection(g, Player.CurrTeam.TeamCode, Player.PlayerCat, Player.PlayerRole);
                dr["FP"]      = c.Calculate(Player, g).Player.Points;
                dr["STATS"]   = Player.StatsFor(g, Player.CurrTeam.TeamCode);
                dr["ACTUAL"]  = ActualScores(g);
                dr["VAR"]     = 0;
                dt.Rows.Add(dr);
                gameCount++;
            }
            return(dt);
        }
Пример #6
0
        private DataTable BuildTable()
        {
            var c = new YahooCalculator();
             var dt = new DataTable();
             var cols = dt.Columns;
             cols.Add("WEEK", typeof (String));
             cols.Add("MATCH", typeof (String));
             cols.Add("SCORE", typeof (String));
             cols.Add("OPPRATE", typeof (String));
             cols.Add("PROJ", typeof (Int16));
             cols.Add("FP", typeof (Decimal));
             cols.Add("STATS", typeof (String));
             cols.Add("ACTUAL", typeof (Decimal));
            cols.Add("ACTUALSTAT", typeof(String));
             cols.Add("VAR", typeof (Decimal));

             var gameCount = 1;
             var byeDone = false;
             foreach (var g in Player.CurrentGames)
             {
            var dr = dt.NewRow();
            g.LoadPrediction( "unit" );
            if ((g.WeekNo > gameCount) && (! byeDone))
            {
               dr["WEEK"] = gameCount;
               dr["MATCH"] = "BYE";
               dr["SCORE"] = "";
               dr["OPPRATE"] = "";
               dr["PROJ"] = 0;
               dr["FP"] = 0.0M;
               dr["STATS"] = "";
               dr["ACTUAL"] = 0;
               dr["VAR"] = 0.0M;
               dt.Rows.Add(dr);
               dr = dt.NewRow();
               byeDone = true;
            }
            var yahooMsg = c.Calculate( Player, g );
            dr["WEEK"] = g.WeekNo;
            dr["MATCH"] = g.OpponentOut(Player.CurrTeam.TeamCode);
            dr["SCORE"] = g.ProjectedScoreOut(Player.CurrTeam.TeamCode);
            dr["OPPRATE"] = OppUnitRating(g, Player.CurrTeam.TeamCode, Player.PlayerCat);
            dr["PROJ"] = GameProjection(g, Player.CurrTeam.TeamCode, Player.PlayerCat, Player.PlayerRole);
            dr[ "STATS" ] = yahooMsg.StatLine();
            var projPts = yahooMsg.Player.Points;
            dr[ "FP" ] = projPts;
            var actPts = Player.ActualFpts( g );
            dr["ACTUAL"] = actPts;
                dr["ACTUALSTAT"] = Player.ActualStatsFor(g);
                dr["VAR"] = actPts - projPts;
            dt.Rows.Add(dr);
            gameCount++;
             }
             return dt;
        }