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); }
public async Task delete_customer_returns_not_found() { var httpResponse = await _client.DeleteAsync(Delete.CustomerById(int.MaxValue)); Assert.Equal(HttpStatusCode.NotFound, httpResponse.StatusCode); }
public async Task delete_customer_returns_bad_request() { var httpResponse = await _client.DeleteAsync(Delete.CustomerById(0)); Assert.Equal(HttpStatusCode.BadRequest, httpResponse.StatusCode); }