6

i am required to quickly learn a mocking framework that allows mocking static methods and write test cases for an application written in C#. which framework would you recommend?

Aadith Ramia
  • 9,649
  • 19
  • 63
  • 85

1 Answers1

13

You can do it using the following frameworks:

  1. Typemock Isolator
  2. JustMock
  3. Moles (You can only stub the methods, you can't assert them).

Example of faking a static method using Isolator:

Isolate.WhenCalled(() => MyClass.MethodReturningZero()).WillReturn(1);

Disclaimer - I work at Typemock

famousgarkin
  • 13,100
  • 5
  • 56
  • 74
Elisha
  • 22,680
  • 6
  • 55
  • 74
  • 4
    -1 for only linking your own product... Find JustMock here: http://www.telerik.com/products/mocking.aspx and Moles here: http://research.microsoft.com/en-us/projects/moles/ – Michiel van Oosterhout Sep 26 '10 at 16:33