コード例 #1
0
        public async void CanReadJson()
        {
            var provider = new WolferhamptonFeed();
            var response = await provider.GetParticipants();

            Assert.True(response.IsValid);
            Assert.Equal(2, response.Data.Count);
        }
コード例 #2
0
        public static IList <IFeed> GetAllFeeds(IServiceProvider serviceProvider)
        {
            //TODO dynamically control the feeds using confid

            var caulFeed = new CaulfieldFeed(EmbeddedFeeds.GetFeed("Caulfield_Race1.xml"));

            var wolfFeed = new WolferhamptonFeed(EmbeddedFeeds.GetFeed("Wolferhampton_Race1.json"));

            return(new List <IFeed> {
                caulFeed, wolfFeed
            });
        }
コード例 #3
0
        public void RetursTheRaceModelFromTheFeedTest()
        {
            var feed = EmbeddedFeeds.GetFeed("Wolferhampton_Race1.json");

            var wolfFeed = new WolferhamptonFeed(feed);

            var actual = wolfFeed.GetRaceTrackWithAllRaces();

            Assert.Equal("13:45 @ Wolverhampton", actual.Races[0].Name);

            Assert.Equal((decimal)4.4, actual.Races[0].Horses[1].Price);
        }