示例#1
0
        public async Task delete_customer_returns_no_content()
        {
            var customer       = GetTestCustomer();
            var content        = new StringContent(JsonConvert.SerializeObject(customer), Encoding.UTF8, "application/json");
            var createResponse = await _client.PostAsync(Post.CreateCustomer, content);

            var id = GetIdFromLocationHeader(createResponse);

            var deleteResponse = await _client.DeleteAsync(Delete.CustomerById(id));

            Assert.Equal(HttpStatusCode.NoContent, deleteResponse.StatusCode);
        }
示例#2
0
        public async Task delete_customer_returns_not_found()
        {
            var httpResponse = await _client.DeleteAsync(Delete.CustomerById(int.MaxValue));

            Assert.Equal(HttpStatusCode.NotFound, httpResponse.StatusCode);
        }
示例#3
0
        public async Task delete_customer_returns_bad_request()
        {
            var httpResponse = await _client.DeleteAsync(Delete.CustomerById(0));

            Assert.Equal(HttpStatusCode.BadRequest, httpResponse.StatusCode);
        }