I am running into some exceptions when I try and mock some property calls from an entity framework model.
The first arrange works fine, but the ToList() call results in an ArgumentNullException.
It looks like it is actually trying to convert 'SomeObject' to a list instead of getting mocked. Any Ideas?
var fakeEntities = Mock.Create<SomeEntities>(Constructor.Mocked);
Mock.Arrange(() => fakeEntities.SomeObjectSet.Count()).Returns(5);
Mock.Arrange(() => fakeEntities.SomeObjectSet.ToList()).Returns(someList);
The first arrange works fine, but the ToList() call results in an ArgumentNullException.
It looks like it is actually trying to convert 'SomeObject' to a list instead of getting mocked. Any Ideas?