public void GetNonJsonResponseHandlesException() { MockRequest("non json response", client.GET_ALL_NOTIFICATIONS_URL, AssertValidRequest, status: HttpStatusCode.NotFound); var ex = Assert.ThrowsAsync <NotifyClientException>(async() => await client.GetNotificationsAsync()); Assert.That(ex.Message, Does.Contain("Status code 404. Error: non json response")); }