English 中文(简体)
Mocking Framework with C# 4.0 Support?
原标题:

Anybody know of a mocking framework that supports C# 4.0? Doesn t matter which one ATM, just need something that will work.

最佳回答

Unless you are looking for something that explicitly use new features of C# 4.0 (and I can t think what that would be off the top of my head), you can use most of the current dynamic mocks that exist for .NET 3.5.

I ve only used Moq on .NET 4.0 (no problems), but I see no reason RhinoMocks and other libraries shouldn t work either.

Most dynamic mock libraries are just .NET libraries, so the backwards compatibility of .NET will (normally) ensure that they still work even if you upgrade to a newer version of the CLR/BCL.

The exception that proves the rule might be TypeMock, since it works in an entirely different way, but I have no experience with it, so I can t say one way or the other if it will work with C# 4.0.

问题回答

We re using NMock and Rhino 3.5 and it seems to work fine for us





相关问题
SoapUI Groovy 方言

我试图阅读即将提出的申请,并根据请求中价值分立的3.0作出模拟反应。 我为此使用了以下大写。

Mocking Entity Context in EF4

I am using VS2010 B2 and EF4 B2 and trying to use Rhino Mocks to mock the entity context generated by EEF. var context = MockRepository.GenerateMock<SomeDBEntities>(); IObjectSet<TxMode> ...

Google Mock for iPhone development?

I have an interesting situation where I am refactoring a bunch of ObjC iPhone code to create a C++ API. I m a novice to C++ and looking into C++ mocking frameworks to augment the work I d done using ...

StrucutureMap RhinoMock Record/Playback, Example needed

I m looking for some examples on how to do the following Mock Tests using StructureMap or Unity with NUnit. I have the following code structure public interface IDAL { List<Model> Method1(...

Easiest way to deal with sample data in Java web apps?

I m writing a Java web app in my free time to learn more about development. I m using the Stripes framework and eventually intend to use hibernate and MySQL For the moment, whilst creating the pages ...

Elegant design of simulating a read-only object

I am currently developing an GUI to an embedded system. (I am using GUI to descripe my app opposed to interface to avoid confusion with the progamatic meaning) Context I have created a class which ...

热门标签