Find method not working with EF6.1 mock
问题 I've setup mocking using these msdn guidlelines: Testing with a mocking framework (EF6 onwards) var bsAc = _db.BusAcnts.FirstOrDefault(i => i.Id == 1); returns an account but var bsAc = _db.BusAcnts.Find(1); returns null when mocked. Find only fails when testing with a mock, it works fine in production. BusAcnt: (Id is the Primary Key) public class BusAcnt { public int Id { get; set; } ... } See the rest of my setup here. In debug I drilled down into Locals | this | MyDbContext and all the