我正在尝试编写一个简单的方法,它接收一个文件并使用NUnit运行它。我设法使用NUnit的源代码构建的代码不起作用:
if(openFileDialog1.ShowDialog() != DialogResult.OK)
{
return;
}
var builder = new TestSuiteBuilder();
var testPackage = new TestPackage(openFileDialog1.FileName);
var directoryName = Path.GetDirectoryName(openFileDialog1.FileName);
testPackage.BasePath = directoryName;
var suite = builder.Build(testPackage);
TestResult result = suite.Run(new NullListener(), TestFilter.Empty);
问题是我一直收到builder.Build抛出的异常,声明没有找到程序集。
我遗漏了什么?有没有其他方法可以从代码运行测试(不使用Process.Start)?
https://stackoverflow.com/questions/2825918
复制相似问题