A wrapper around Pact .Net Implementation. To offer extension methods in order to run Pact tests easily.
Run Pact as usual or utilise the useful methods we have provided
See the [Examples] section of the repo to see implementation details
Create a new instance of the Provider Service in your Setup and Start the Mock Service ready for setting up your mock
_providerService = new ProviderService("Consumer", "Provider","./Config");
_providerService.Initialize();
Once your contract has been verified with VerifyInteractions
. Then you can create your pact file using
_providerService.Build();
Often you can find yourself repeating the process of adding pact matchers to fields in your response. Why not pass a C# object to these cheat methods to automatically add the matchers on conversion to a JSON Object.
Example:
_providerService.ConstructResponseBody(new ResponseBody())
With the request we simply pass the C# object to the JSON request body.
Example:
_providerService.ConstructRequestBody(new RequestBody())
TO DO: How to use these methods