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
  • 10,005
  • 19
  • 67
  • 86

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,687
  • 5
  • 58
  • 74
Elisha
  • 23,310
  • 6
  • 60
  • 75
  • 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