I have been attempting to learn how we can mock out calls to entity framework in our project. I ran into this problem where we are using EntityFunctions.TruncateTime. The error says: this function can only be invoked from linq to entities. If this should be supported help on what i'm doing wrong, if its not then i guess we are out of luck for those scenarios.
where audit.DTS < EntityFunctions.TruncateTime(mydate)
var fakeEntities = Mock.Create<SomeDBEntities>();
var audits = GetAudits();
Mock.Arrange(() => fakeEntities.Audits).ReturnsCollection(audits);
var target =
var result = target.test(DateTime.Now);