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#?
相关问题
- Generic Generics in Managed C++
- How to Debug/Register a Permanent WMI Event Which
- 'System.Threading.ThreadAbortException' in
- Bulk update SQL Server C#
- Dependencies while implementing Mocking in Junit4
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.
You can try Rhino Mocks or NMocks
Moles allows to replace any .NET method with a delegate. Any method including static methods or methods in sealed types.