I've found that Linq2Sql doesn't (Rhino) mock well, as the interfaces I need aren't there. Does EF generate code that's more mockable?
NOTE: I'm not mocking,开发者_JS百科 yet, without interfaces, the next reader of this question may not have my bias.
EDIT: VS2008 / 3.5 for now.
Entity Framework 1.0 is mockable: http://blogs.msdn.com/diego/archive/2008/03/03/unit-testing-your-entity-framework-domain-classes.aspx
It's not pretty, but it's possible. EF 4 is much improved over EF 1.0 in this regard.
I would think that if, for example, you have Data Access Objects (DAOs) over your Linq2SQL objects they can implement intefaces and therefore work well with RhinoMocks.
精彩评论