Created
December 15, 2018 18:39
-
-
Save alexjamesbrown/2d62b8adf5fcf85d0cfd34bbbf7dca5c to your computer and use it in GitHub Desktop.
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
//Arrange | |
var mockCustomerService = new Mock(); | |
var customerController = new CustomerController(mockCustomerService.Object); | |
Customer customerServiceSaveArg = null; | |
mockCustomerService | |
.Setup(x => x.Save(It.IsAny())) | |
.Returns(1) | |
.Callback(c => customerServiceSaveArg = c); | |
//Act | |
var result = customerController.Post("Alex", "Brown"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment