Running NUnit Tests from Code
- by Dror Helper
I'm trying to write a simple method that receives a file an runs it using NUnit.
The code I managed to build using NUnit's source does not work:
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);
The problem is that I keep getting an exception thrown by builder.Build stating that the assembly was not found.
What am I missing?