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
832 stars 230 forks source link

Update workshop v3 // update link #398

Closed mefellows closed 1 day ago

mefellows commented 2 years ago

The README still has a link to this old workshop, which is quite outdated relative to the current status of this project.

Ideally, this workshop is updated to reflect the latest/greatest things.

Should we (in the mean time) remove the link?

See also https://github.com/DiUS/pact-workshop-dotnet-core-v3/issues/1#issuecomment-1141763721.

adamrodger commented 2 years ago

I don't think it's all that outdated (the general API usage is correct and the flow is right) but it definitely needs some work. Some problems I can see:

mefellows commented 2 years ago

Well, I agree with all that - which is why I'm raising it ;)

We get quite a few comments/issues on that workshop and it seems to be a cause of confusion. I'm finding myself pointing people back to your examples/docs because they are up to date.e I think we should bring the workshop into the foundation (especially now the awesome 4.x.x is live 🙌 ), what do you think?

cc: @YOU54F for visibility. I don't think there is much work to do to bring it up to speed, would be a great one to see if we can get some community contributors on.

riezebosch commented 1 year ago

I don't think it's all that outdated (the general API usage is correct and the flow is right) but it definitely needs some work. Some problems I can see:

  • [x] Using an alpha version of PactNet from an Artifactory instance instead of latest from nuget.org
  • [x] The tests use async void instead of async Task
  • [x] Using .GetAwaiter().GetResult() from a sync Main instead of making it async
  • [x] The mock server uses a hard-coded port, which is not recommended, and then creates the HttpClient once using that port. It's recommended to create the HttpClient inside the VerifyAsync lambda using the URI from the verification context
  • [ ] The diagrams are SVGs with transparent backgrounds and black text, which can't be seen in dark mode
  • [ ] There are some typo/style problems, such as the Authorization section has one test embedded inside another because of a missed closing brace

https://github.com/DiUS/pact-workshop-dotnet-core-v3/pull/7

also updated to net6.0 and changed to minimal api and removed all unused classes.

YOU54F commented 1 year ago

Awesome @riezebosch - thanks for casting your eyes over and even more thanks for your PR! Will bring it to attention of the team and take it for a spin 👍🏾

mefellows commented 1 year ago

Amazing! Thanks.

I think with the SVGs, we could just save them and remove transparency - that would be the simplest thing.

YOU54F commented 1 year ago

Thanks @riezebosch for kicking this off

To all Pact-netizens, got some goodies for you, wouldn't mind some eyes across them :)

PS. I have to say, the DSL is pact-net 4.x is quite nice, and the delta between 3.x -> 4.x isn't bad at all, especially once you've got one test converted, the rest is relatively plain sailing.

adamrodger commented 1 day ago

@YOU54F recently updated the link in the README to point to the new workshop, so this one can be closed now