public async Task testRequestForAvailableCompetitionsAsyncReturnsCorrectList()
        {
            StreamReader jsonReader = new StreamReader(@"../../Data/competitions.json");
            string       json       = jsonReader.ReadToEnd();

            jsonReader.Close();
            dataServiceMock.Setup(s => s.MakeJsonWebRequestAsync(It.IsAny <string>())).Returns(() => Task.Factory.StartNew(() => json));

            List <Competition> competitions = await target.GetAvailableCompetitionsAsync();

            Assert.AreEqual(1, competitions.Count, "Number of available competitions is incorrect");
            Assert.AreEqual(1204, competitions.First().Id);
            Assert.AreEqual("Premier League", competitions.First().Name);
        }
Example #2
0
        public async Task testCompetitionRequestToServer()
        {
            List <Competition> competitions = await footballDataService.GetAvailableCompetitionsAsync();

            Assert.AreEqual(1, competitions.Count, "Number of available competitions is incorrect");
            Assert.AreEqual(1204, competitions.First().Id);
            Assert.AreEqual("Premier League", competitions.First().Name);
        }