Contents tagged with Mock

  • One more summary of Moq library

    Examples of Mock usages

    Mock - is a simple and lightweight isolation framework, which is built on the basis of anonymous methods and expression trees. To create them it uses code generation, thus allowing to mock interfaces, virtual methods (and even protected methods) and does not allow to mock non-virtual and static methods.


    At market exists only two frameworks that allow to mock anything. These are TypeMockIsolator and Microsoft Fakes, available in Visual Studio 2012 and higher. These frameworks, unlike Mock ( which uses code generation) use CLR Profiling API, allowing to mock any method even for static, virtual and private methods. IMHO they are good for testing legacy code … more