public async void BadFormattedJsonContent(string jsonString) { // Arrange MockHttpMessageHandler mockHttp = MockTools.GetNewMockHandler(); mockHttp.When(HttpMethod.Get, "*/test").Respond(HttpStatusCode.OK, "application/failed", jsonString); HttpClient httpClient = mockHttp.ToHttpClient(); // Act HttpResponseMessage httpResponse = await httpClient.GetAsync("http://test.com/test"); // Assert BunnyInvalidResponseException exception = await Assert.ThrowsAsync <BunnyInvalidResponseException>(async() => { await JsonWrapper.Deserialize <object>(httpResponse); }); }
public async void Storage_GetFolder_invalidResponse(string path) { BunnyInvalidResponseException exception = await Assert.ThrowsAsync <BunnyInvalidResponseException>(async() => { await storage.GetFolder(path); }); }