public async Task NotSuccessStatusCode_ThrowsHttpRequestException() { var mockHttpHandler = HttpHandler.GetMockFailedHttpHandlerObject(); var giphy = new Giphy(mockHttpHandler); var id = "xT4uQulxzV39haRFjG"; _ = await Assert.ThrowsAsync <HttpRequestException>(() => giphy.GifById(id)); }
public async Task GifIdIsEmpty_ThrowsFormatException() { var giphy = new Giphy("test"); string id = ""; _ = await Assert.ThrowsAsync <FormatException>(() => giphy.GifById(id)); }
public async Task WhenCalled_ReturnsGiphySingle() { var mockHttpHandler = HttpHandler.GetMockSuccessHttpHandlerObject(); var giphy = new Giphy(mockHttpHandler); var id = "xT4uQulxzV39haRFjG"; var actual = await giphy.GifById(id); Assert.NotNull(actual); Assert.IsType <GiphySingle>(actual); }