2

したがって、次のように別のプログラムでコマンド「vstest.console.exe」を使用して実行する NUnit 3.2.1 でコンパイルされたテストの 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.

簡単に言えば、同じディレクトリに nunit.framework.dll がなくても、nunit テストの dll を起動することは可能ですか? ありがとう

4

1 に答える 1