Hi so I want to setup Pact with my .NET service.Ho...
# general
s
Hi so I want to setup Pact with my .NET service.How can I set up PACT with the microservice? should i make provider tests? Since we wouldn't have a contract file at this stage, I would comment that part out for now?
b
For starting off with Pact in general, there are plenty of code samples and tutorials.
1
howtolearn
s
Here are a number of useful hands-on labs that teach all of the key concepts: https://docs.pactflow.io/docs/workshops and https://docs.pact.io/implementation_guides/workshops
b
I'm not a .NET person, but there should be some samples for that, once you're more familiar with the core concepts.
thankyou 1
t
You can set up verification even if you don't have any pacts. Some pact languages will fail if there are no pacts found, but I believe this is configurable for all.
👌 1
s
ah ok that’s good! so i can start with setting up my provider tests. I won’t have a consumer expected response to compare to but i can still pretend I do?
t
Yes, but you won't be testing anything
Alternatively, you could create a fake contract with a fake client. This can help you validate that your service is doing what you think it does, but it won't give you the deployment confidence that proper consumer tests do
s
ah okay! that makes sense thank you
also, is it usually recommended to mock my API and database for the provider tests? or should i run my service and then test the API calls to the local server? which is more standard?
t
Mock as little as possible. We might need more details to understand the question well enough to answer clearly though
👍 1