Skip to content

Instantly share code, notes, and snippets.

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