Beispiel #1
0
        public void GetFullSchedule_MockWebApi_FullSchedule()
        {
            // Arrange
            var json     = File.ReadAllText(Path.Combine(BasePath, DomainObjectFactoryTests.JSON_DATA_PATH, "schedule.json"));
            var mockHttp = new MockHttpMessageHandler();

            mockHttp.Expect($"{BASE_API_URL}/schedule/full")
            .Respond("application/json", json);

            var tvMazeClient = new TvMazeClient(BASE_API_URL, mockHttp.ToHttpClient());

            // Act
            var schedule = tvMazeClient.GetFullSchedule();

            // Assert
            Assert.IsNotNull(schedule);
            Assert.IsNotEmpty(schedule.Episodes);
            mockHttp.VerifyNoOutstandingExpectation();
        }