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> objectSet = new List<TxMode> { mode }.AsObjectSet();
context.Expect(c => c.TxModes).Return(objectSet);
The problem is that c.TxModes
is a property of type ObjectSet<TxMode>
whereas I am trying to return an IObjectSet<TxMode>
and I get the following compile error:
Error 4 The best overloaded method match for
Rhino.Mocks.Interfaces.IMethodOptions<System.Data.Objects.ObjectSet
<Data.Entities.TxMode>>.Return(System.Data.Objects.ObjectSet
<Data.Entities.TxMode>) has some invalid arguments.
The AsObjectSet extension method comes from here.
Any idea how I can get this to compile?