Mocking tools for C# on .NET [closed]

2019-05-07 16:26发布

I'm new to C#/.NET but I've been doing TDD for quite some time now. I want to know what is the best framework that can be used for mocking objects while writing tests in C#?

3条回答
贼婆χ
2楼-- · 2019-05-07 16:43

Popular options

Moq and Rhino are both regular mock/stub framework. TypeMock Isolator is a bit special, as it modifies the IL to allow mocking of types you have no control over. Some like this a lot. Others feel it is too intrusive.

查看更多
叛逆
3楼-- · 2019-05-07 17:00

You can try Rhino Mocks or NMocks

查看更多
Melony?
4楼-- · 2019-05-07 17:02

Moles allows to replace any .NET method with a delegate. Any method including static methods or methods in sealed types.

查看更多
登录 后发表回答