0
我使用EntityFramework Reverse POCO Generator具有标志EF反向POCO发电机单元测试
AddUnitTestingDbContext = true; // Will add a FakeDbContext and FakeDbSet for easy unit testing
它创建FakeDbContext和FakeDbSet进行单元测试,但里面FakeDbContext一些方法未实现。
public System.Data.Entity.Infrastructure.DbEntityEntry<TEntity> Entry<TEntity>(TEntity entity) where TEntity : class
{
throw new System.NotImplementedException();
}
public System.Data.Entity.Infrastructure.DbEntityEntry Entry(object entity)
{
throw new System.NotImplementedException();
}
public System.Collections.Generic.IEnumerable<System.Data.Entity.Validation.DbEntityValidationResult> GetValidationErrors()
{
throw new System.NotImplementedException();
}
public System.Data.Entity.DbSet Set(System.Type entityType)
{
throw new System.NotImplementedException();
}
public System.Data.Entity.DbSet<TEntity> Set<TEntity>() where TEntity : class
{
throw new System.NotImplementedException();
}
public override string ToString()
{
throw new System.NotImplementedException();
}
什么是覆盖它们或实现它们,这样我可以用我的单元测试这些调用的正确方法。
谢谢你的时间。
我将离开假上下文作为“一次性”的产生和定制。 –
我该怎么做? – Farukh
移出环境。然后填写原始空白。 –