예제 #1
0
        public void TestYahooMasterGet()
        {
            var m    = new YahooMaster("Yahoo", "YahooOutput.xml");
            var stat = m.GetStat("2013:02:MANNPE01");

            Assert.AreEqual(19.0M, stat);
        }
예제 #2
0
        public void TestYahooMasterGetVick2013Week03()
        {
            var m    = new YahooMaster("Yahoo", "YahooOutput.xml");
            var stat = m.GetStat("2013:03:VICKMI01");

            Assert.AreEqual(17.0M, stat);
        }
예제 #3
0
        public void TestEspnScorerAccesstoYahooXml()
        {
            var m   = new YahooMaster("Yahoo", "YahooOutput.xml");
            var pts = m.GetStat("2012:04:AKERDA01");

            Assert.AreEqual(11, pts, "Akers got 11 pts in week 4 of 2012");
        }
예제 #4
0
        public void TestRosterGridPerfomanceReport()
        {
            var master = new YahooMaster("Yahoo", "YahooOutput.xml");
            var cat    = Constants.K_RUNNINGBACK_CAT;

            RosterGrid.RosterGrid.GenericEspnPerformance(cat, master, Constants.K_LEAGUE_Rants_n_Raves, "RB");
        }
예제 #5
0
        private static void GenerateYahooXml()
        {
            var m = new YahooMaster("Yahoo", "YahooOutput.xml");

            m.Calculate(Utility.CurrentSeason(), Utility.CurrentWeek());
            m.Dump2Xml();
        }
예제 #6
0
        private static string WeeklyEspnPerformance(
            string catCode, int week, string leagueId, [System.Runtime.InteropServices.Optional] string sPos)
        {
            var pl = new PlayerLister {
                WeeksToGoBack = 1
            };
            var master      = new YahooMaster("Yahoo", "YahooOutput.xml");
            var currentWeek =
                new NFLWeek(Int32.Parse(Utility.CurrentSeason()), weekIn: week, loadGames: false);
            var gs = new EspnScorer(currentWeek)
            {
                Master = master
            };

            pl.SetScorer(gs);
            pl.SetFormat("weekly");
            pl.AllWeeks    = false;          //  just the regular saeason
            pl.Season      = currentWeek.Season;
            pl.RenderToCsv = false;
            pl.Week        = week;
            pl.Collect(catCode, sPos: sPos, fantasyLeague: leagueId);

            var targetFile = string.Format("{4}{3}//Performance//{2}-Yahoo {1} Performance upto Week {0}.htm",
                                           currentWeek.WeekNo, sPos, leagueId, pl.Season, Utility.OutputDirectory());

            pl.Render(targetFile);
            return(pl.FileOut);
        }
예제 #7
0
        public void TestYahooMasterCalculating()
        {
            var m = new YahooMaster("Yahoo", "YahooOutput.xml");

            m.Calculate("2013", "06");
            m.Dump2Xml();
            Assert.IsTrue(File.Exists(m.Filename));
        }
예제 #8
0
        public void TestGenYahooAllPositionsCurrentWeek()
        {
            var m = new YahooMaster("Yahoo", "YahooOutput.xml");

            m.Calculate("2013", Utility.CurrentWeek());
            m.Dump2Xml();
            Assert.IsTrue(File.Exists(m.Filename));
            TestAllPositionsBeastModeCurrentWeek();
            TestAllPositionsYahooCurrentWeek();
            TestAllPositionsRantsCurrentWeek();
        }
예제 #9
0
        public void TestYahooMasterPersistence()
        {
            var m    = new YahooMaster("Yahoo", "YahooOutput.xml");
            var stat = new RosterLib.Models.YahooOutput
            {
                Season   = "2012",
                Week     = "01",
                PlayerId = "GRIFRO01",
                Opponent = "NO",
                Quantity = 30.0M
            };

            m.PutStat(stat);
            m.Dump2Xml();
            Assert.IsTrue(File.Exists(m.Filename), string.Format("{0} not found", m.Filename));
        }
예제 #10
0
        public void TestYahooMasterConstructor()
        {
            var m = new YahooMaster("Yahoo", "YahooOutput.xml");

            Assert.IsNotNull(m);
        }