以下构造函数参数没有匹配的fixture数据:DbContextOptions' 1options

时间:2016-12-28 19:51:12

标签: unit-testing dependency-injection asp.net-core xunit.net asp.net-core-1.1

   public class StudentService
    {   


}

我有一个学生班,我正在访问MsDbContext来做与实体框架相关的工作。在上面的代码中,选项来自abstractDbBasedService。

AbstractDbBasedService:

public class AbstractDbBasedService

}

现在,我有一个测试类,我正在访问所有上述服务。

StudentTestClass:

    public class StudentServicesTests : AbstractDbBasedService
    {

}        
       [Fact]
        public void Assert_CreatedStudent_WhenStudentParemeterInvalid()
        {

        }

}

当我尝试运行测试时,它给出了错误 - 以下构造函数参数没有匹配的fixture数据:DbContextOptions' 1选项。请帮帮我。

0 个答案:

没有答案