I have a service that receives a request, generates an email, saves the email to message queue (to be sent by other microservice) and returns httpStatus.Ok. I want to test that for different requests a relevant email will be generated.
According to Contract Tests vs Functional Tests my tests are functional, not contract tests. (If my service would return email content as an api response, using Pact for contract tests will certainly be appropriate).
I have an idea to use Pact infrastructure for such functional tests, in particular
1.Save request and expected generated email into Pact Broker
2. In provider Verify tests submit the request and verify generated email with expected email.
Does it make sense to use Pact in such functional tests?
Does anyone know examples of similar usage?
Any alternative technologies ( preferably in .Net Core) to have similar testing?
I am also considering https://github.com/approvals/ApprovalTests.Net, but Pact infrastructure attracts me more.
Related note: The Pact normally works with http requests/responses, but Pact V3 (not implemented by PackNet yet) Introduces messages for services that communicate via event streams and message queues. An example describes messages pact contract tests is https://dius.com.au/2017/09/22/contract-testing-serverless-and-asynchronous-applications/ referenced by Pact for MessageQueue's : Sample Provider test in case of MessageQueues