hi team, I am going to write Provider tests to ver...
# pact-net
s
hi team, I am going to write Provider tests to verify my contract, and this will work by running my service in conjunction with the tests. Is this a standard approach? Also, in that case, would I still need to create a TestStartup.cs and ProviderStateMiddleware as seen in the examples? My endpoint GET method is simple and just returns a list of hardcoded string values at the moment. The example I'm referring to: https://github.com/pact-foundation/pact-net/blob/9a4aea964ed6d176adcc566bc138badff8aa47eb/samples/OrdersApi/Provider.Tests/TestStartup.cs#L9
m
If you don’t have provider states now, but envisage needing them in the future then you may as well get it ready.
Most Pact suites will have them, so if your goal is to be prepared for when you have real consumers then I would
Running your provider locally is what you should be doing, if that’s the question?
s
alright thank you! makes sense
👍 1
also with the URI we provide in the provider test, is it any random URI on localhost? and that runs our API since we add our actual services to the IServicesCollection ?