xunit - xunit.runner.visualstudio 2.4.2-preview.22

Visual Studio 2017 15.9+ Test Explorer runner for the xUnit.net framework. Capable of running xUnit.net v1.9.2 and v2.0+ tests. Supports .NET 2.0 or later, .NET Core 2.1 or later, and Universal Windows 10.0.16299 or later.

PM> Install-Package xunit.runner.visualstudio -Version 2.4.2-preview.22 -Source https://www.myget.org/F/xunit/api/v3/index.json

Copy to clipboard

> nuget.exe install xunit.runner.visualstudio -Version 2.4.2-preview.22 -Source https://www.myget.org/F/xunit/api/v3/index.json

Copy to clipboard

> dotnet add package xunit.runner.visualstudio --version 2.4.2-preview.22 --source https://www.myget.org/F/xunit/api/v3/index.json

Copy to clipboard
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2-preview.22" />
Copy to clipboard
source https://www.myget.org/F/xunit/api/v3/index.json

nuget xunit.runner.visualstudio  ~> 2.4.2-preview.22
Copy to clipboard

> choco install xunit.runner.visualstudio --version 2.4.2-preview.22 --source https://www.myget.org/F/xunit/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "xunit" -SourceLocation "https://www.myget.org/F/xunit/api/v2"
Install-Module -Name "xunit.runner.visualstudio" -RequiredVersion "2.4.2-preview.22" -Repository "xunit" -AllowPreRelease
Copy to clipboard

About This Project

This project contains the Visual Studio runner for xUnit.net. It supports the built-in Test Explorer feature in Visual Studio 2012 and later (all editions except Express). It supports Desktop .NET 2.0, Windows 8.1, Windows Phone 8.1 Applications, and Universal Windows Apps 10.0 (and later). It can run tests from xUnit.net 1.9.2 and later.

To open an issue for this project, please visit the core xUnit.net project issue tracker.

Debugging

Debugging the VS Adapter is tricky. There are two ways to do it depending on whether you want to do it under net46 or netcoreapp2.1. In all cases, you'll currently need to build your own test adapter NuGet package using build.ps1, build.ps1 Packages first to ensure you have local symbols. The symbols are not in the public package. It's helpful to add it to a local \packages directory and then use an entry like <add key="Local Packages" value=".\packages" /> in your NuGet.config file to point to it. Don't forget to eventually delete it from your global profile .nuget\packages\xunit... when you're done.

net46

Easiest thing to do is add a launchSettings.json file that adds the vstest.console.exe as a startup project and point it to an xunit dll. Something like the following (use /listtests if you just want to debug the discovery portion):

{
  "profiles": {
    "vstest console": {
      "executablePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe",
      "commandLineArgs": ".\\bin\\Debug\\net46\\Tests.System.Reactive.dll /TestAdapterPath:.\\bin\\Debug\\net46 /listtests",
      "workingDirectory": "C:\\dev\\RxNET\\Rx.NET\\Source\\Tests.System.Reactive\\"
    }
  }
}

With that as the startup project, you can set breakpoints and then hit them. You may need to manually load symbols the first time if it's not detected automatically.

netcoreapp2.1

Debugging the .NET Core version of the runner is currently much more difficult. You'll need Process Explorer to help locate the correct process to debug. This limitation should be improved in subsequent .NET Test Platform releases.

  1. Start a PowerShell console and navigate to the directory with your test project
  2. Set an environment variable in that console session: $env:VSTEST_HOST_DEBUG = 1
  3. Build your test project: dotnet build
  4. Have VS open with the xUnit solution loaded
  5. Have Process Explorer open and in Tree View mode. You may want to update the "highlight delay" settings to 2-3 settings. Defaults to 1. Make the list scroll roughly to the "d's"
  6. Execute the test: dotnet vstest .\bin\debug\netcoreapp2.1\MyTest.dll (you can use the -lt switch to do discovery only)
  7. The test adapter will wait for about 30 seconds for you to attach a debugger. You need to look for the "lowest" dotnet.exe process in the tree like this: img. In this case, the PID you're looking for is 79404.
  8. In VS, go to Debug -> Attach to Process and look for the PID (easiest to sort the column by PID). Ensure the debugger type is "Automatic" and it'll choose the CoreCLR debugger.
  9. Attach and then quickly hit Continue. It should load up the adapter and related code with symbols.

About xUnit.net

xUnit.net is a free, open source, community-focused unit testing tool for the .NET Framework. Written by the original inventor of NUnit v2, xUnit.net is the latest technology for unit testing C#, F#, VB.NET and other .NET languages. xUnit.net works with ReSharper, CodeRush, TestDriven.NET and Xamarin. It is part of the .NET Foundation, and operates under their code of conduct. It is licensed under Apache 2 (an OSI approved license).

For project documentation, please visit the xUnit.net project home.

  • .NETFramework 4.5.2
  • .NETCoreApp 2.1
  • UAP 10.0.16299
  • .NETCoreApp 2.1: 2.1.0.0
  • .NETFramework 4.5.2: 4.5.2.0
  • UAP 10.0.16299: 10.0.16299.0

Signature validation information

Informational

Signature Hash Algorithm: SHA256

Signature type: Author

Verifying the author primary signature with certificate: 
  Subject Name: CN=xUnit.net (.NET Foundation), O=xUnit.net (.NET Foundation), L=Redmond, S=WA, C=US, SERIALNUMBER=603389068
  SHA1 hash: 89835CA46FC09C05E8C59AE2473DDA9292339630
  SHA256 hash: B8F6A977E333577BC4DA250BDB42B08171EB3C814E6502A7D5393828D8813DFE
  Issued by: CN=.NET Foundation Projects Code Signing CA, O=.NET Foundation, C=US
  Valid from: 5/30/2018 12:00:00 AM to 6/3/2021 12:00:00 PM

Timestamp: 12/19/2018 3:07:34 AM

Verifying author primary signature's timestamp with timestamping service certificate: 
  Subject Name: CN=DigiCert SHA2 Timestamp Responder, O=DigiCert, C=US
  SHA1 hash: 400191475C98891DEBA104AF47091B5EB6D4CBCB
  SHA256 hash: FC834D5BFFDE31DBA5B79BF95F573F7953BCBF9156E8525163E828EB92EA8A93
  Issued by: CN=DigiCert SHA2 Assured ID Timestamping CA, OU=www.digicert.com, O=DigiCert Inc, C=US
  Valid from: 1/4/2017 12:00:00 AM to 1/18/2028 12:00:00 AM

Owners

Brad Wilson Oren Novotny

Authors

.NET Foundation and Contributors

Project URL

https://github.com/xunit/visualstudio.xunit

License

Apache-2.0

Signature

Validation: Valid

Info

2820 total downloads
0 downloads for version 2.4.2-preview.22
Download (765.51 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
2.4.2-preview.22 765.51 KB Wed, 19 Dec 2018 03:08:06 GMT 0
2.4.2-preview.21 765.46 KB Wed, 19 Dec 2018 02:17:14 GMT 0
2.4.2-preview.18.1e6cc12b4e 734.91 KB Wed, 19 Dec 2018 01:36:02 GMT 0
2.4.2-preview.18 765.41 KB Wed, 19 Dec 2018 01:51:12 GMT 0
2.4.2-preview.17.19c89555ea 630.58 KB Wed, 19 Dec 2018 01:18:03 GMT 0
2.4.2-preview.15 660.1 KB Tue, 18 Dec 2018 23:04:07 GMT 0
2.4.1 675.53 KB Mon, 29 Oct 2018 04:24:48 GMT 0
2.4.1-pre.build.4072 677.38 KB Sun, 07 Oct 2018 07:34:30 GMT 0
2.4.1-pre.build.4071 677.4 KB Sun, 07 Oct 2018 03:46:43 GMT 0
2.4.1-pre.build.4069 677.39 KB Tue, 02 Oct 2018 15:26:02 GMT 0
2.4.1-pre.build.4066 677.4 KB Sun, 30 Sep 2018 23:08:45 GMT 0
2.4.1-pre.build.4064 677.35 KB Sat, 29 Sep 2018 23:06:13 GMT 0
2.4.1-pre.build.4063 677.31 KB Sat, 29 Sep 2018 22:59:16 GMT 0
2.4.1-pre.build.4062 677.32 KB Sat, 29 Sep 2018 22:23:53 GMT 0
2.4.1-pre.build.4059 675.88 KB Sat, 25 Aug 2018 20:21:54 GMT 0
2.4.1-pre.build.4057 675.82 KB Sat, 25 Aug 2018 19:20:55 GMT 0
2.4.1-alpha.1.build4055 675.87 KB Wed, 22 Aug 2018 15:46:27 GMT 0
2.4.1-alpha.1.build4054 675.84 KB Mon, 20 Aug 2018 23:30:33 GMT 0
2.4.0 674.21 KB Tue, 17 Jul 2018 04:19:42 GMT 0
2.4.0-rc.2.build4048 675.79 KB Mon, 16 Jul 2018 02:46:49 GMT 0
2.4.0-rc.2.build4046 675.71 KB Fri, 13 Jul 2018 02:43:50 GMT 0
2.4.0-rc.2.build4045 675.76 KB Fri, 13 Jul 2018 00:46:57 GMT 0
2.4.0-rc.1.build4044 675.77 KB Thu, 12 Jul 2018 23:11:45 GMT 0
2.4.0-rc.1.build4042 675.75 KB Wed, 04 Jul 2018 22:13:44 GMT 0
2.4.0-rc.1.build4041 675.77 KB Mon, 02 Jul 2018 16:25:14 GMT 0
2.4.0-rc.1.build4038 675.71 KB Mon, 02 Jul 2018 04:00:03 GMT 0
2.4.0-rc.1.build4037 675.79 KB Mon, 02 Jul 2018 01:32:59 GMT 0
2.4.0-rc.1.build4036 675.83 KB Mon, 02 Jul 2018 00:58:49 GMT 0
2.4.0-rc.1.build4035 675.79 KB Sun, 01 Jul 2018 16:12:55 GMT 0
2.4.0-beta.3.build4034 675.85 KB Wed, 27 Jun 2018 05:43:11 GMT 0
2.4.0-beta.3.build4032 675.8 KB Mon, 25 Jun 2018 18:31:36 GMT 0
2.4.0-beta.3.build4031 675.84 KB Mon, 25 Jun 2018 17:36:52 GMT 0
2.4.0-beta.3.build4028 675.89 KB Mon, 25 Jun 2018 16:51:21 GMT 0
2.4.0-beta.3.build4026 675.78 KB Thu, 21 Jun 2018 17:07:25 GMT 0
2.4.0-beta.3.build4025 675.81 KB Thu, 21 Jun 2018 16:57:17 GMT 0
2.4.0-beta.3.build4024 674.7 KB Sun, 17 Jun 2018 03:42:12 GMT 0
2.4.0-beta.3.build4022 674.74 KB Sat, 16 Jun 2018 22:43:54 GMT 0
2.4.0-beta.3.build4013 674.61 KB Tue, 05 Jun 2018 05:29:46 GMT 0
2.4.0-beta.3.build4012 674.68 KB Fri, 01 Jun 2018 19:31:58 GMT 0
2.4.0-beta.2.build4010 672.42 KB Sat, 26 May 2018 19:03:17 GMT 0
2.4.0-beta.2.build4009 672.44 KB Sat, 26 May 2018 17:24:15 GMT 0
2.4.0-beta.2.build4008 672.36 KB Fri, 25 May 2018 18:21:37 GMT 0
2.4.0-beta.2.build4005 672.43 KB Thu, 24 May 2018 20:30:43 GMT 0
2.4.0-beta.2.build4004 672.42 KB Thu, 24 May 2018 19:28:34 GMT 0
2.4.0-beta.2.build4003 672.41 KB Mon, 21 May 2018 15:32:58 GMT 0
2.4.0-beta.2.build4002 672.46 KB Mon, 21 May 2018 14:41:59 GMT 0
2.4.0-beta.2.build4001 672.39 KB Mon, 21 May 2018 12:14:47 GMT 0
2.4.0-beta.2.build3996 603.86 KB Mon, 21 May 2018 00:37:45 GMT 0
2.4.0-beta.2.build3992 672.02 KB Wed, 16 May 2018 17:31:01 GMT 0
2.4.0-beta.2.build3990 672 KB Wed, 16 May 2018 17:11:07 GMT 0
2.4.0-beta.2.build3988 672.03 KB Wed, 16 May 2018 01:48:05 GMT 0
2.4.0-beta.2.build3987 671.98 KB Mon, 14 May 2018 20:43:46 GMT 0
2.3.1 660.4 KB Fri, 27 Oct 2017 05:37:35 GMT 102
2.3.0 726.17 KB Fri, 06 Oct 2017 22:15:12 GMT 40
2.2.0 302.56 KB Sun, 19 Feb 2017 23:24:31 GMT 1390
2.1.0 183.46 KB Sun, 27 Sep 2015 17:45:48 GMT 1288