✅ Vertical Slicing with MediatR and Unit Testing

Hello everyone. I've recently come across Vertical Slice architecture and was amused by it, I think it is a nice approach to build a web api based on features. I've watched Jimmy Bogard's talk on Vertical slicing with MediatR, but was confused on how to implement unit testing. I only have a controller which send commands or queries through a mediator object, and a handler that handles this request. In his talk, Jimmy said to not worry about unnecessary abstractions like a Repository for example, we can just pass in the DbContext (in the case of EF Core). But if that's the case, how can I actually unit test my code when all of my code is inside the handlers since they aren't too big.
No description
5 Replies
Salah Tanbour
Salah Tanbour5mo ago
Should I create a repo that wraps Dbcontext to mock it?
jcotton42
jcotton425mo ago
$close since you're being helped in #architecture
MODiX
MODiX5mo ago
Use the /close command to mark a forum thread as answered
jcotton42
jcotton425mo ago
(please)
Salah Tanbour
Salah Tanbour5mo ago
ok
Want results from more Discord servers?
Add your server
More Posts