Closed mefellows closed 1 day 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:
async void
instead of async Task
.GetAwaiter().GetResult()
from a sync Main
instead of making it asyncHttpClient
once using that port. It's recommended to create the HttpClient
inside the VerifyAsync
lambda using the URI from the verification contextWell, 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.
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 ofasync Task
- [x] Using
.GetAwaiter().GetResult()
from a syncMain
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 theHttpClient
inside theVerifyAsync
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.
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 👍🏾
Amazing! Thanks.
I think with the SVGs, we could just save them and remove transparency - that would be the simplest thing.
Thanks @riezebosch for kicking this off
To all Pact-netizens, got some goodies for you, wouldn't mind some eyes across them :)
I think we may in the very near future, to consolidate all the things.
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.
@YOU54F recently updated the link in the README to point to the new workshop, so this one can be closed now
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.