Skip to content

Instantly share code, notes, and snippets.

@alexjamesbrown
Created December 15, 2018 18:39
Show Gist options
  • Select an option

  • Save alexjamesbrown/2d62b8adf5fcf85d0cfd34bbbf7dca5c to your computer and use it in GitHub Desktop.

Select an option

Save alexjamesbrown/2d62b8adf5fcf85d0cfd34bbbf7dca5c to your computer and use it in GitHub Desktop.
//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