我有一些测试使用NHibernate和SQLite来测试内存中的数据库组件。 测试工作室中的测试运行良好,但是MSTest.exe控制台运行器拒绝运行我的所有测试。控制器运行程序由构建服务器使用,该服务器使用TeamCity运行所有测试,我使用机器上的MSTest.exe查看本地控制台运行程序也失败。
我有这个内在的例外:
NHibernate.HibernateException: Could not create the driver fromNHibernate.Driver.SQLite20Driver, NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed
大多数回答者包括向App.config添加正确的参考程序集到sqlite,但测试项目是一个类库。
在我的测试项目中,我引用了以下程序集:
ClassInitialize有错误的签名。参数1的类型应为Microsoft.VisualStudio.TestTools.UnitTesting.TestContext
我使用以下工具:
知道如何继续这个吗? 谢谢!
答案 0 :(得分:0)
好的,最后我使用vstest.console.exe控制台运行程序来执行测试,它确实有效。 (不知道那里出了什么问题) 如果你有兴趣将这个跑步者与Teamcity联系起来,那就读得很好: http://blog.dontpaniclabs.com/post/2013/06/13/TeamCity-Builds-with-the-Visual-Studio-2012-Test-Runner