public void RemoveClaimAsync_IdentityAdminThrows_ReturnsErrors() { IdentityAdminImpl.SetupRemoveClaimAsync(new Exception("Boom")); var resp = Delete("api/Clients/123/claim/123"); Assert.AreEqual(HttpStatusCode.InternalServerError, resp.StatusCode); }
public void RemoveClaimAsync_IdentityAdminReturnsError_ReturnsError() { IdentityAdminImpl.SetupRemoveClaimAsync("foo", "bar"); var resp = Delete("api/Clients/123/claim/123"); Assert.AreEqual(HttpStatusCode.BadRequest, resp.StatusCode); var error = resp.Content.ReadAsAsync <ErrorModel>().Result; Assert.AreEqual(2, error.Errors.Length); CollectionAssert.Contains(error.Errors, "foo"); CollectionAssert.Contains(error.Errors, "bar"); }