How to run Nunit3 tests programatically?

21 views
Skip to first unread message

part...@gmail.com

unread,
Nov 24, 2020, 12:09:08 AM11/24/20
to NUnit-Discuss
Hi,
I checked various blogs but I dint find a solution. Looks like those are not supported in latest version. I am not able to use those namespaces. I would like to run nunit tests programatically for nunit 3.12, Which DLL I need to use and how?

Thanks,
Parth

part...@gmail.com

unread,
Nov 24, 2020, 12:53:42 AM11/24/20
to NUnit-Discuss
I got it by using Nunit.Engine from nuget
ITestEngine engine = TestEngineActivator.CreateInstance();
TestPackage package = new TestPackage(@"TestProjects.dll");
ITestRunner runner = engine.GetRunner(package);
XmlNode result = runner.Run(new MyEventListener(), TestFilter.Empty);

Reply all
Reply to author
Forward
0 new messages