Hi all. I'm having some issues getting the Messagi...
# pact-net
r
Hi all. I'm having some issues getting the Messaging example to work. When I try to implement it, the IMessagePactBuilderV3.WithJsonContent() is not returning an IConfiguredMessageVerifier, but an IMessagePactBuilderV3. So the .Verify() method cannot be resolved in the ReceiveSomeStockEvents() test, because it thinks it's the wrong type. I created a minimal repo that shows the issue here: https://github.com/rishispeets/pact-net-messaging-example-test/blob/master/TestProject1/StockEventProcessorTests.cs. I get the same behaviour in a non-trivial project. It's the exact same copied code from the PactNet repo, but I must be doing something wrong, because it works when I clone the PactNet repo and run that. Does anybody know what the issue might be? (I'm pretty new to dotnet btw)
k
When I cloned down some of the samples I was opening a project/folder individually instead of the entire collection of samples. When I did that, I realized I was missing some project references to the latest version of Pact (4.0). I had to install the 4.0 (preview I think) Nuget package of Pact, and then some of the interfaces, etc started working for me. Not sure if this is your case or not.
a
The API just changed after the beta 2 release, so the latest version won't match it. Using beta 2, the Verify method is on the builder
So the docs and sample are correct and will be the API for the next release, but they're not correct for beta 2. If you check the samples from a few commits back you'll see the Verify method in a separate call
r
Awesome, that did the trick 🙂. Thanks both!