Moq requirements? Defeats the purpose?
问题 Doesn't being required to virtualize all property accessors you want to mock kind of defeat the purpose of mocking? I mean, if I have to modify my object and virtualize every single accesor I want to mock, couldn't I just as well inherit my class and mock it myself? 回答1: Your question is very valid but if you think about it,there is no other way to mock a class. If you take an interface, it's just a contract so the mock framework can mock how ever you want it but if you take a class, it