开发者

looking for a C# mocking framework that allows mocking static methods [closed]

开发者 https://www.devze.com 2023-01-14 13:36 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Improve this question

i am required to quickly learn a mocking framework that allows mocking static methods and write test cases for an a开发者_JS百科pplication written in C#. which framework would you recommend?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消