public void ReadFromStream_FeedInvalidXml_ThrowsException() { var feedReader = new CaulfieldRaceFeedReader(); Exception ex = Assert.Throws <InvalidFeedException>(() => feedReader.ReadFromStream(_fixture.FeedInvalidXml)); Assert.IsType <InvalidOperationException>(ex.InnerException); }
public void ReadFromStream_FeedIsValid_ReturnsRace() { var feedReader = new CaulfieldRaceFeedReader(); var race = feedReader.ReadFromStream(_fixture.FeedValid); Assert.NotNull(race); Assert.NotEmpty(race.Horses); }
public void ReadFromStream_FeedThreeHorses_ReturnsRaceWithThreeHorses() { var feedReader = new CaulfieldRaceFeedReader(); var race = feedReader.ReadFromStream(_fixture.FeedThreeHorses); Assert.NotNull(race); Assert.NotEmpty(race.Horses); Assert.Equal(3, race.Horses.Length); }
public void ReadFromStream_FeedHasNoRace_ThrowsException() { var feedReader = new CaulfieldRaceFeedReader(); Exception ex = Assert.Throws <InvalidFeedException>(() => feedReader.ReadFromStream(_fixture.FeedNoRace)); }