简体   繁体   English

Intellitest 2015在单元测试通过的地方失败

[英]Intellitest 2015 is failing where as the Unit test is getting passed

I am using Visual Studio 2015 IntelliTest to do the data driven test execution which is very useful tool for data driven testing. 我正在使用Visual Studio 2015 IntelliTest来执行数据驱动的测试执行,这对于数据驱动的测试非常有用。 Visual Studio 2015 Intelli test is getting failed when I am running the intellitest from a project created by intellitest. 当我从智能测试创建的项目中运行智能测试时,Visual Studio 2015 Intelli测试失败。 But the same is passing when running the test from a test explorer window. 但是,从“测试资源管理器”窗口中运行测试时,也通过了同样的测试。 We have implemented repository pattern and using Entity Framework 6.0 to carry out the database operations. 我们已经实现了存储库模式,并使用Entity Framework 6.0来执行数据库操作。 Please find the stack trace below for more information. 请在下面找到堆栈跟踪以获取更多信息。 Can anyone help me on this? 谁可以帮我这个事?

  System.NullReferenceException: Object reference not set to an instance of an object.     
  at System.Void MyFramework.Persistence.Entity.EF1Repository..ctor(System.String connectionStringName, System.String objContextName) 
 at System.Void MyFramework.Persistence.PersistenceManager..ctor(System.String schema, System.String module) 
at System.Collections.Generic.List`1<MyDTO> BusinessLogic.ListedPassenger.Passengers(MyDTO entity) 
at System.Collections.Generic.List`1<MyDTO> BusinessLogic.Tests.ListedPassengerTest.PassengersTest(BusinessLogic.ListedPassenger target, MyDTO entity)

Please ensure that your test is isolated from the environment using appropriate mock implementations (using Fakes, etc.). 请确保使用适当的模拟实现(使用Fakes等)将测试与环境隔离。 Take a look here for a hands-on example: https://blogs.msdn.microsoft.com/visualstudioalm/2015/08/14/intellitest-hands-on/ . 在这里查看动手示例: https : //blogs.msdn.microsoft.com/visualstudioalm/2015/08/14/intellitest-hands-on/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM