Пример #1
0
        public async Task GetCrewCreditsAsync_MockWebApi_PersonId_CrewCredits()
        {
            // Arrange
            const int personId = 1;
            var       json     = File.ReadAllText(Path.Combine(BasePath, DomainObjectFactoryTests.JSON_DATA_PATH, "person_crewcredits.json"));
            var       mockHttp = new MockHttpMessageHandler();

            mockHttp.Expect($"{BASE_API_URL}/people/{personId}/crewcredits")
            .Respond("application/json", json);

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

            // Act
            var crewCredits = await tvMazeClient.GetCrewCreditsAsync(personId);

            // Assert
            Assert.IsNotNull(crewCredits);
            Assert.IsNotEmpty(crewCredits);
            mockHttp.VerifyNoOutstandingExpectation();
        }