public void GetRaceWithScraper() { _scraper = new HrScraper(); //TODO: make this match a current race // find available tracks/races here: http://www.equibase.com/static/entry/index.html // sample url http://www.equibase.com/static/entry/GP032119USA7-EQB.html var countryCode = "USA"; var trackCode = "GP"; var raceDate = HrUtilities.ParseDateMDY("032119"); var raceNumber = 7; var race = _scraper.GetRaceEntries(countryCode, trackCode, raceDate, raceNumber); Assert.IsNotNull(race); Assert.IsTrue(race.RaceNumber == raceNumber); Assert.IsTrue(race.RaceDate.ToShortDateString() == raceDate.ToShortDateString()); Assert.IsTrue(race.TrackCode == trackCode); Assert.IsTrue(race.CountryCode == countryCode); Assert.IsTrue(race.Entries != null); Assert.IsTrue(race.Entries.Count > 0); this.AssertEntry(race.Entries[0], race); this.AssertEntry(race.Entries[1], race); }
public void GetRaceWithMoqScraper() { _scraper = new MoqScraper(); var countryCode = "USA"; var trackCode = "GP"; var raceDate = HrUtilities.ParseDateMDY("032019"); var raceNumber = 7; // http://www.equibase.com/static/entry/GP032119USA7-EQB.html var race = _scraper.GetRaceEntries(countryCode, trackCode, raceDate, raceNumber); Assert.IsNotNull(race); Assert.IsTrue(race.RaceNumber == raceNumber); Assert.IsTrue(race.RaceDate.ToShortDateString() == raceDate.ToShortDateString()); Assert.IsTrue(race.TrackCode == trackCode); Assert.IsTrue(race.CountryCode == countryCode); Assert.IsTrue(race.Entries != null); Assert.IsTrue(race.Entries.Count > 0); this.AssertEntry(race.Entries[0], race); this.AssertEntry(race.Entries[1], race); }