Skip to content

Instantly share code, notes, and snippets.

Last active August 22, 2019 19:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
public async Task ShouldSubmitCorrectPayload()
// ... Do all the set up required i.e. stubs, domain objects
// with pre-cooked data neccesary to execute the behaviour.
// Build the service/adapter object with this mock HttpMessageHandler
var loopbackHttpHandler = new SubmissionServiceHttpHandlerStub();
var submitter = new SubmissionService(
new HttpClient(loopbackHttpHandler)
BaseAddress = new Uri("")
var useCase = CreateUseCase(submitter);
// verify that what will have been submitted to the external
// service would have been the right data
var payload = loopbackHttpHandler.PayloadDto("key");
// other assertions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment