© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
24 replies
Sebastian

What's correct unit testing?

In codebase I am working on some devs are writing unit tests that test Controller level - tests if endpoint returns 200 for example. They mock repository/DAL layer and ignore service layer.

Wouldn't the correct thing to do be just mock the service layer and then test service layer functions separately and mock repo layer in that test?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Is my unit testing approach correct?
C#CC# / help
2y ago
unit testing
C#CC# / help
2y ago
Unit testing
C#CC# / help
2y ago
✅ Unit testing
C#CC# / help
3y ago