pact-foundation / pact-net

.NET version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://pact.io
MIT License
846 stars 232 forks source link

PactVerifierSource WithDirectorySource Method Not Work #456

Closed alex-zinich closed 1 year ago

alex-zinich commented 1 year ago

I have one pact test on my provider. I have a folder with different contracts with Consumer. When I run the test, it always passes, I tried changing the expected result in the contract, but the test still passed. After researching, I realized that the test does not send http requests, so it always passes. The folder is not empty, it has the contract files. When I used another method: WithFileSource, the test started sending http requests and working.

image

adamrodger commented 1 year ago

Could you attach the contents of the directory and the output logs at Debug level please?

I assume that no matching pact files are being found due to naming differences or something, but the logs should tell us.

alex-zinich commented 1 year ago

Directory with file image

DirectoryInfo path image

File with pact exists inside folder Consumer image

Test result image

Example code inside file image

adamrodger commented 1 year ago

Have you edited the file name or the file contents? Neither of those match your test so wouldn't be used.

adamrodger commented 1 year ago

For example, the file says 'User_API' (with an underscore) whilst the test says 'User API' (with a space).

The file name is also not in the expected format of 'Consumer-Provider.json'

alex-zinich commented 1 year ago

Thanks a lot! I don't knew about strong naming in test file, "provider" section When I changed User API to User_API everything started working