예제 #1
0
        public void ReadFromStream_FeedInvalidXml_ThrowsException()
        {
            var feedReader = new CaulfieldRaceFeedReader();

            Exception ex = Assert.Throws <InvalidFeedException>(() => feedReader.ReadFromStream(_fixture.FeedInvalidXml));

            Assert.IsType <InvalidOperationException>(ex.InnerException);
        }
예제 #2
0
        public void ReadFromStream_FeedIsValid_ReturnsRace()
        {
            var feedReader = new CaulfieldRaceFeedReader();
            var race       = feedReader.ReadFromStream(_fixture.FeedValid);

            Assert.NotNull(race);
            Assert.NotEmpty(race.Horses);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public void ReadFromStream_FeedHasNoRace_ThrowsException()
        {
            var feedReader = new CaulfieldRaceFeedReader();

            Exception ex = Assert.Throws <InvalidFeedException>(() => feedReader.ReadFromStream(_fixture.FeedNoRace));
        }