所以我有我的NUnit 3.2.1编译测试的dll,我在另一个程序中使用命令“vstest.console.exe”运行如下:运行NUnit测试没有nunit.framework.dll在同一个存储库
var Args = "/UseVsixExtensions:true" + " " + "\"" + @"D:\path\myDllTestNunit.dll" + "\"" +
" " + "/TestAdapterPath:" + "\"" + @"C:\path\NUnit3TestAdapter.3.0.10\lib" + "\"" +
" " + "/Logger:trx" + " /settings:" + "\"" + @"D:\pathRunsettings\dbci_2016_06_23_10_01_56.runsettings" + "\"";
var cmdPath = @"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe";
var proc = new Process();
proc.StartInfo.FileName = cmdPath;
proc.StartInfo.Arguments = Args;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = true;
proc.EnableRaisingEvents = true;
proc.StartInfo.CreateNoWindow = false;
proc.ErrorDataReceived += proc_DataReceived;
proc.OutputDataReceived += proc_DataReceived;
proc.StartInfo.UseShellExecute = false;
proc.Start();
proc.BeginErrorReadLine();
proc.BeginOutputReadLine();
proc.WaitForExit();
Console.ReadLine();
我的问题是,我想用这个命令,但没有在同一目录下有nunit.framework.dll中执行我的测试。我试图把这个在GAC,但我还有以下错误(与NUnit的适配器已经尝试过最后一个版本太多,仍然得到了相同):
>>> Starting test execution, please wait...
>>> Information: NUnit Adapter 3.0.10.0: Test execution started
>>>
>>> Information: Running all tests in D:\appli\statro\RSS3_BATCHES_TEST\UT\LANCE
MENT_TESTS\RSS3.Batches.Test.Nunit.Tests.dll
>>>
>>> Warning: Dependent Assembly nunit.framework of D:\appli\statro\RSS3_BATCHES_
TEST\UT\LANCEMENT_TESTS\RSS3.Batches.Test.Nunit.Tests.dll not found. Can be igno
red if not a NUnit project.
>>>
>>> Information: NUnit Adapter 3.0.10.0: Test execution complete
>>>
>>> Warning: No test is available in D:\appli\statro\RSS3_BATCHES_TEST\UT\LANCEM
ENT_TESTS\RSS3.Batches.Test.Nunit.Tests.dll. Make sure that installed test disco
verers & executors, platform & framework version settings are appropriate and tr
y again.
所以,长话短说,就是有可能启动我的dun的nunit测试,而不是在同一目录中有nunit.framework.dll? 谢谢
*为什么*你想这样做?测试程序集预计能够加载'nunit.framework.dll' ...就像这样简单。 –
那么我将不得不在多个目录下启动多个dll的测试命令,我不想在每个目录中安装nunit.Framework.dll以启动这些测试。所以我想把它放在其他地方(试用GAC),但似乎参考找不到它。 – neow
但你是如何建立这些测试组件?我期望构建过程自动包含测试程序集的所有依赖项 - 包括nunit.framework.dll。 –