Intuitive and clean mocking for automated tests — with example in .NET Core

Magnus Stuhr
Aug 25, 2019 · 6 min read

Robert C. Martin argues in his book “Clean Code” (2009, page 133) that writing clean test-code is perhaps even more important than writing clean production-code, “because tests preserve and enhance the flexibility, maintainability, and reusability of the production code”. I very much agree with him. Even when assuming that all the business logic in the…