问题:
终于尝试在项目中应用单元测试,一开始一切都按部就班的进行,一切良好,点[运行].显示出错结果,仔细看了下,异常信息为
Test method XinGongShe.Membership.Test.AccountManagerTest.UpdateUserRankPointsTest threw exception: System.TypeInitializationException: The type initializer for 'XinGongShe.Membership.MembershipDataProvider' threw an exception. ---> System.IO.FileNotFoundException: Could not find file 'E:\Developing\XinGongShe Framework Solution\TestResults\Administrator_HEX 2009-07-28 19_23_34\Out\XinGongShe.config'..
原来配置文件没有自动复制到对应的测试目录,单元测试的生成目录是临时的,所以也不能简单的复制剪贴.
解决方案: 手工添加配置文件(针对vs2008英文版)
终于尝试在项目中应用单元测试,一开始一切都按部就班的进行,一切良好,点[运行].显示出错结果,仔细看了下,异常信息为
Test method XinGongShe.Membership.Test.AccountManagerTest.UpdateUserRankPointsTest threw exception: System.TypeInitializationException: The type initializer for 'XinGongShe.Membership.MembershipDataProvider' threw an exception. ---> System.IO.FileNotFoundException: Could not find file 'E:\Developing\XinGongShe Framework Solution\TestResults\Administrator_HEX 2009-07-28 19_23_34\Out\XinGongShe.config'..
原来配置文件没有自动复制到对应的测试目录,单元测试的生成目录是临时的,所以也不能简单的复制剪贴.
解决方案: 手工添加配置文件(针对vs2008英文版)
- 双击 LocalTestRun.testrunconfig 文件
- 选择 deployment 选项
- 单击 Add
- 选择配置文件.