public void SaveCustomer() { var testCustomer = new Customer { Id = 5, Name = "Norman" }; var isSuccessful = _service.SaveCustomer(testCustomer); Assert.IsTrue(isSuccessful); }
public async Task <IActionResult> PostCustomer([FromBody] Customer customer) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _service.SaveCustomer(customer); return(CreatedAtAction("GetCustomer", new { id = customer.Id }, customer)); }