There are some features in the isolation framework (Mocking framework) Moq which I see is used blindly. Most of the time it can which reduce test readability and maintainability. One of the worst offender in this regards is VerifyAll. In this post I’m going to elaborate why this method is so pernicious to readability and …
moq
Isolation Frameworks: Why FakeItEasy and NSubstitude Are Better Than Moq
I’ve been trying out different isolation frameworks lately and reading about their features and differences. In terms of feature, most constrained isolation frameworks are almost the same. But there are couple of important points about naming and readability that I think worth paying attention to. I’ve used Moq in my previous projects, but recently, I’ve …
Moq: Working With SetupGet, VerifyGet, SetupSet, VerifySet, SetupProperty
Moq has a set of methods specific to stubbing and verification of properties. In this post I’m going to go over each one of them, and explain when and why to use them. I also discuss their differences and in what situation we might want to use them. Let’s assume we have an interface with …