I have an NUnit project creating a Console Application for running tests. The entry point looks like this:
class Program
{
[STAThread]
static void Main(string[] args)
{
string[] my_args = { Assembly.GetExecutingAssembly().Location };
int returnCode = NUnit.ConsoleRunner.Runner.Main(my_args);
if (returnCode != 0)
Console.Beep();
}
}
What can I pass in as an argument if I wanted to run this one test ONLY:
[TestFixture]
public class EmailNotificationTest
{
[Test]
public void MailerDefaultTest()
{
Assert.IsTrue(false);
}
}
Clearly this is supported, and just as clearly I have no idea how to do it.
UPDATE
It looks like with v3+, this is possible with the --test
option, per the documentation.
[Explicit]
and[Category]
attributes.nunit3-console.exe
see stackoverflow.com/questions/37297838/…