Esempio n. 1
0
        public void DeleteClientAsync_IdentityAdminThrows_ReturnsErrors()
        {
            ClientServiceImpl.SetupDeleteClientAsync(new Exception("Boom"));
            var response = Delete("api/Clients/123");

            Assert.AreEqual(HttpStatusCode.InternalServerError, response.StatusCode);
        }
Esempio n. 2
0
        public void DeleteClientAsync_IdentityAdminReturnsError_ReturnsError()
        {
            ClientServiceImpl.SetupDeleteClientAsync("foo", "bar");
            var resp = Delete("api/Clients/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");
        }