Пример #1
0
        public void Mlb_GetPostSeasonForTeamWithNoPostSeasonTest()
        {
            MlbSeasonType    seasonType = MlbSeasonType.PostSeason;
            MlbTeamShortName teamName   = MlbTeamShortName.MIA;
            int seasonYear = 2007;

            List <MlbGameSummaryModel> result = MlbAttendanceQuery.GetSeasonForTeam(seasonType, teamName, seasonYear);

            Assert.AreEqual(MlbSeasonType.PostSeason, result[0].MlbSeasonType, "Verify that the game is a Postseason game");
            Assert.AreEqual(null, result, "Verify that there are 0 games returned");
        }
Пример #2
0
        public void Mlb_GetSpringSeasonForTeamTest()
        {
            MlbSeasonType    seasonType = MlbSeasonType.Spring;
            MlbTeamShortName teamName   = MlbTeamShortName.NYY;
            int seasonYear = 2012;

            List <MlbGameSummaryModel> result = MlbAttendanceQuery.GetSeasonForTeam(seasonType, teamName, seasonYear);

            Assert.AreEqual(12, result.Count, "Verify that there are 12 home games returned");
            Assert.AreEqual(MlbSeasonType.Spring, result[0].MlbSeasonType, "Verify that the game is a Spring season game");
            Assert.AreEqual(new DateTime(2012, 3, 2), result[0].Date, "Verify that the date of the first game is 3/2/2012");
            Assert.AreEqual(2012, result[0].Year, "Verify that the Season is 2012");
            Assert.AreEqual(MlbTeamShortName.NYY.ToString(), result[1].Home, "Verify that the home team is NYY");
            Assert.AreEqual(MlbTeamShortName.TB.ToString(), result[2].Visitor, "Verify that the away team is TB");
        }
Пример #3
0
        public void Mlb_GetRegularSeasonForTeamTest()
        {
            MlbSeasonType    seasonType = MlbSeasonType.Regular;
            MlbTeamShortName teamName   = MlbTeamShortName.SEA;
            int seasonYear = 2010;

            List <MlbGameSummaryModel> result = MlbAttendanceQuery.GetSeasonForTeam(seasonType, teamName, seasonYear);

            Assert.AreEqual(81, result.Count, "Verify that there are 81 home games returned");

            Assert.AreEqual(MlbSeasonType.Regular, result[0].MlbSeasonType, "Verify that the game is a Regular season game");
            Assert.AreEqual(new DateTime(2010, 10, 3), result[80].Date, "Verify that the date of the last game is 10/3/2010");
            Assert.AreEqual(MlbTeamShortName.SEA.ToString(), result[80].Home, "Verify that the home team is SEA");
            Assert.AreEqual(MlbTeamShortName.OAK.ToString(), result[80].Visitor, "Verify that the away team is OAK");
            Assert.AreEqual(3, result[80].HomeScore, "Verify that the home score is 3");
            Assert.AreEqual(4, result[80].VisitorScore, "Verify that visitor score is 4");
            Assert.AreEqual(61, result[80].WinsToDate, "Verify that the wins to date is 61");
            Assert.AreEqual(101, result[80].LossesToDate, "Verify that losses to date is 101");
            Assert.AreEqual("Braden", result[80].WPitcher, "Verify that the W Pitcher is Braden");
            Assert.AreEqual("Varvaro", result[80].LPitcher, "Verify that the L Pitcher is Varvaro");
            Assert.AreEqual("Breslow", result[80].SavePitcher, "Verify that the Save Pitcher is Breslow");
            Assert.AreEqual(23278, result[80].Attendance, "Verify that attendance is 23278");
        }
Пример #4
0
        public void Mlb_GetPostSeasonForTeamTest()
        {
            MlbSeasonType    seasonType = MlbSeasonType.PostSeason;
            MlbTeamShortName teamName   = MlbTeamShortName.BOS;
            int seasonYear = 2008;

            List <MlbGameSummaryModel> result = MlbAttendanceQuery.GetSeasonForTeam(seasonType, teamName, seasonYear);

            Assert.AreEqual(5, result.Count, "Verify that there are 5 home games returned");
            Assert.AreEqual(2008, result[0].Year, "Verify that the Season is 2008");
            Assert.AreEqual(MlbSeasonType.PostSeason, result[0].MlbSeasonType, "Verify that the game is a Postseason game");
            Assert.AreEqual(new DateTime(2008, 10, 6), result[1].Date, "Verify that the date of the last game is 10/6/2008");
            Assert.AreEqual(MlbTeamShortName.BOS.ToString(), result[1].Home, "Verify that the home team is BOS");
            Assert.AreEqual(MlbTeamShortName.LAA.ToString(), result[1].Visitor, "Verify that the away team is LAA");
            Assert.AreEqual(3, result[1].HomeScore, "Verify that the home score is 3");
            Assert.AreEqual(2, result[1].VisitorScore, "Verify that visitor score is 2");
            Assert.AreEqual(3, result[1].WinsToDate, "Verify that the wins to date is 3");
            Assert.AreEqual(1, result[1].LossesToDate, "Verify that losses to date is 1");
            Assert.AreEqual("Delcarmen", result[1].WPitcher, "Verify that the W Pitcher is Delcarmen");
            Assert.AreEqual("Shields", result[1].LPitcher, "Verify that the L Pitcher is Shields");
            Assert.AreEqual(null, result[1].SavePitcher, "Verify that the Save Pitcher is empty");
            Assert.AreEqual(38785, result[1].Attendance, "Verify that attendance is 38785");
        }