@JonCanning @dustinmoris @davidfowl@shanselman I also prefer #3. It's nice and concise code which is I guess in line with the minimal API direction of travel: concise and simple.
@johnkilmister@mark_heath Great book! So is Continuous Delivery which is a great follow up by David Farley and Jez Humble. It goes into the technical details of how to do it.
@BelloneDavide You're in luck actually @BelloneDavide. Take a look at the tests here. Feel free to DM if you want to have a little chat about it: https://t.co/6WXFi1FY1H
@BelloneDavide No interfaces required. High level tests from Controller to repository mock. Tests spin up the service in memory e.g. using WebApplicationFactory. Allows for easy refactoring without breaking tests.
@BelloneDavide Okay so I used to use A but now use neither. Now have a Services folder then one for each use case e.g. CreateNewFlightPlan. In that folder have the MediatR handlers, commands/queries and validators.
@peterekepeter@BelloneDavide Agreed on the high-level tests rather than lots of brittle tests that test a single class with everything mocked out. Makes for simpler and more refactorable code as no one wants to touch something if it breaks 50 tests :)
@GioviQuarella@BelloneDavide Yes, have had to put interfaces in their own NuGet package before as needed their versions not to change while I updated the implementations. Usually don't do this for services though as don't need to worry about NuGet versions.
Finally it's out 🤩
This was one of the most demanding articles I've ever written.
I took a GIST published by @davidfowl, dissected it, and used it to learn about .NET customizations, HttpClients, HttpMessages, and more.
What a ride 💪
https://t.co/R0uzQwsq2s