Ejemplo n.º 1
0
        public void GetScheduleTestDate()
        {
            NHLApiClient api = new NHLApiClient();

            var testResponse = File.ReadAllText(@"../../../TestAPIResponses/GetScheduleDateResult.json");
            var jobj         = JObject.Parse(testResponse);
            var expected     = JsonConvert.DeserializeObject <ScheduleData>(jobj.ToString());

            // Make API web call
            var          date   = DateTime.Parse("2019-01-01");
            ScheduleData actual = api.GetSchedule(date);

            //Assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void GetScheduleTestTeamDateRange()
        {
            NHLApiClient api = new NHLApiClient();

            var testResponse = File.ReadAllText(@"../../../TestAPIResponses/GetScheduleTeamDateRangeResult.json");
            var jobj         = JObject.Parse(testResponse);
            var expected     = JsonConvert.DeserializeObject <ScheduleData>(jobj.ToString());

            // Make API web call
            var          startDate = DateTime.Parse("2018-12-20");
            var          endDate   = DateTime.Parse("2018-12-30");
            ScheduleData actual    = api.GetSchedule(startDate, endDate, 52); // Winnipeg Jets

            //Assert
            Assert.AreEqual(expected, actual);
        }