public async Task GetFilmWorldMovieListAsync_DoesReturnSuccess_HttpErrorReturned() { var httpClientWrapper = A.Fake <IHttpClientWrapper>(); A.CallTo(() => httpClientWrapper.GetStringAsync(A <string> .Ignored, A <CancellationToken> .Ignored)) .ThrowsAsync(new HttpRequestException()); var loggerFake = A.Fake <ILogger>(); _systemUnderTest = new MovieApiClient(httpClientWrapper, Options.Create(new MovieApiUris()), Options.Create(new ApiRequestDetails()), loggerFake); var result = await _systemUnderTest.GetFilmWorldMovieListAsync(new CancellationToken()); result.Should().NotBeNull(); result.Movies.Should().BeNull(); }
public async Task GetFilmWorldMovieListAsync_DoesDataParseSuccess_DataFailedParsing() { var httpClientWrapper = A.Fake <IHttpClientWrapper>(); A.CallTo(() => httpClientWrapper.GetStringAsync(A <string> .Ignored, A <CancellationToken> .Ignored)) .Returns(Task.FromResult("not parable string")); var loggerFake = A.Fake <ILogger>(); _systemUnderTest = new MovieApiClient(httpClientWrapper, Options.Create(new MovieApiUris()), Options.Create(new ApiRequestDetails()), loggerFake); var result = await _systemUnderTest.GetFilmWorldMovieListAsync(new CancellationToken()); result.Should().NotBeNull(); result.Movies.Should().BeNull(); }