Last active
December 15, 2018 18:33
-
-
Save alexjamesbrown/e8045d654db8bc6411baa341610b8c5f to your computer and use it in GitHub Desktop.
For demo purposes: https://www.alexjamesbrown.com/blog/development/better-assertions-when-verifying-moqd-methods-have-been-called/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomerController : Controller | |
{ | |
private ICustomerService _customerService; | |
public CustomerController(ICustomerService customerService) | |
{ | |
_customerService = customerService; | |
} | |
public IActionResult Post(string firstName, string lastName) | |
{ | |
var customer = new Customer | |
{ | |
FirstName = firstName, | |
LastName = lastName | |
}; | |
var customerId = customerService.Save(customer); | |
return Created("/customer/" + customerId, customer); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment