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