Sunday, August 24, 2014

xUnit Console Runner - Filter by Test Name

You can now filter by test name with the xUnit Console Runner.

Sample Code

namespace DemoProject
{
    public class ExampleTests
    {
        [Fact]
        public void HelloWorld()
        {
            Assert.True(true);
        }
 
        [Fact]
        public void GoodnightMoon()
        {
            Assert.True(false);
        }
    }
}

Sample Command Line

C:\>xunit.console.exe DemoProject.dll -testName "DemoProject.ExampleTests.HelloWorld"
xUnit.net console test runner (64-bit .NET 4.0.30319.18449)
Copyright (C) 2014 Outercurve Foundation.

Starting:  DemoProject.dll
Finished: DemoProject.dll

=== TEST EXECUTION SUMMARY ===
   DemoProject.dll  Total: 1, Failed: 0, Skipped: 0, Time: 0.276s, Errors: 0

Enjoy,
Tom

2 comments:

  1. https://www.nuget.org/packages/xunit.runner.console/2.2.0-beta2-build3300

    ReplyDelete

Real Time Web Analytics