Skip to content
This repository has been archived by the owner on Dec 12, 2017. It is now read-only.

Xunit2 support #1

Merged
merged 26 commits into from
Nov 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
84020be
Initial tests for annotations, plus work on xunit2
citizenmatt Aug 12, 2014
3e6ab44
Merge branch 'xunit2' into xunit2-annotations
citizenmatt Apr 1, 2015
8413813
Work in progress on annotations
citizenmatt Apr 7, 2015
8316dc3
Completed xunit.assert annotations
citizenmatt Apr 10, 2015
d306972
Added xunit.core annotations
citizenmatt Apr 10, 2015
bfc0196
Merge branch 'xunit2' into xunit2-annotations
citizenmatt Apr 10, 2015
3dc4f28
Disable some dodgy annotation tests
citizenmatt Apr 10, 2015
893d91c
Updated nuspec for ReSharper 9.0
citizenmatt Apr 10, 2015
a8fed67
Preparing release for 2.1.6
citizenmatt Apr 10, 2015
ebfa811
Updating readme
citizenmatt Apr 10, 2015
3d2bfa6
Defensive coding if exception data is wonky
citizenmatt Apr 27, 2015
a16b58d
Bumped versions for 8.2 and 9.1 support
citizenmatt Apr 27, 2015
a28448d
Bumped version for 9.0 support
citizenmatt Aug 2, 2015
6f188e2
Clean compile for 9.2 EAP 7
citizenmatt Aug 4, 2015
6b44c5c
Disable shadow copy for tests
citizenmatt Aug 5, 2015
327334b
Added missing 9.1 SDK tests + updated to latest SDK
citizenmatt Aug 5, 2015
b860a74
Added SDK.Tests to 9.2 project
citizenmatt Aug 5, 2015
f124b6c
9.2 testing requires STA
citizenmatt Aug 5, 2015
65046b8
Remove pure attribute from asserts
citizenmatt Aug 5, 2015
e73d6a3
9.2 nuspec
citizenmatt Aug 5, 2015
c539f07
Nicer log messages
citizenmatt Aug 7, 2015
df95a20
9.2 RC2 support
citizenmatt Aug 13, 2015
f1fbb09
9.2 SDK
citizenmatt Oct 9, 2015
7e638b8
Tweaks to logging
citizenmatt Oct 9, 2015
0b6b71f
In-editor discovery of static test classes
citizenmatt Oct 9, 2015
69646ab
Updated nuspec for 2.2.9 release
citizenmatt Oct 9, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This plugin for ReSharper adds support for xUnit.net tests. It supports the foll
* Discovery and execution of `[Fact]` and `[Theory]` based tests from source code, or compiled assemblies (e.g. F# projects can run tests, although tests aren't found in the source editor)
* External annotations to provide hints to ReSharper that test methods are being implicitly used, and that assert methods check for null, etc.
* Live Templates to easily create asserts, test methods, etc.
* Support for ReSharper 8.2 and 9.0.
* Support for ReSharper 8.2 and 9.1. ReSharper 9.0 support is still available from the Extension Manager, but is no longer being maintained. Please upgrade to 9.1

Previously hosted on CodePlex as the [xunitcontrib](http://xunitcontrib.codeplex.com) project.

Expand All @@ -19,7 +19,6 @@ The plugin can be installed from ReSharper's Extension Manager.
Both xUnit.net 1.x and 2.0 are fully supported when running tests, however, the 2.0 support has the following limitations in the editor:

* Test discovery is still based on 1.x. That means it will only find tests that are marked with `[Fact]` or other attributes that derive from `FactAttribute` (this includes `[Theory]`). Custom test discovery is not yet supported.
* External annotations have not yet been implemented for xUnit.net 2.0, meaning ReSharper doesn't know that asserts will terminate the method, and can give warnings such as possible null reference exception, even after `Assert.NotNull`.
* The Live Templates are still based on 1.x. The biggest problem here is that `[Theory]` is in the wrong namespace.
* There is no code completion for `[MemberData]` has not yet been implemented. xUnit.net 1.x's `[PropertyData]` is still supported.

Expand Down
2 changes: 2 additions & 0 deletions resharper/.nuget/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.VC120.CRT.JetBrains" version="12.0.21005.1" />
<package id="Wave" version="1.0.0.0" />
<package id="WinDbg.SymStore" version="8.1.20130822.1832" />
</packages>
2 changes: 1 addition & 1 deletion resharper/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
[assembly : AssemblyDescription("xUnit.net unit test provider for " + ProductInfo.Product)]
[assembly : AssemblyCopyright("Copyright (C) Matt Ellis")]
[assembly : ComVisible(false)]
[assembly : AssemblyVersion("2.0.0.*")]
[assembly : AssemblyVersion("2.0.6.*")]
770 changes: 770 additions & 0 deletions resharper/ExternalAnnotations/xunit.assert.xml

Large diffs are not rendered by default.

109 changes: 109 additions & 0 deletions resharper/ExternalAnnotations/xunit.core.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<assembly name="xunit.core">

<!-- Marks anything decorated with [Fact] or derived as in use. Also marks the
containing class as in use -->
<member name="T:Xunit.FactAttribute">
<attribute ctor="M:JetBrains.Annotations.MeansImplicitUseAttribute.#ctor" />
</member>

<member name="M:Xunit.Record.Exception(System.Action)">
<attribute ctor="M:JetBrains.Annotations.AssertionMethodAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.CanBeNullAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.PureAttribute.#ctor" />
<parameter name="testCode">
<attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
</parameter>
</member>

<member name="M:Xunit.Record.Exception(System.Func{System.Object})">
<attribute ctor="M:JetBrains.Annotations.AssertionMethodAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.CanBeNullAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.PureAttribute.#ctor" />
<parameter name="testCode">
<attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
</parameter>
</member>

<member name="M:Xunit.Record.ExceptionAsync(System.Func{System.Threading.Tasks.Task})">
<attribute ctor="M:JetBrains.Annotations.AssertionMethodAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.CanBeNullAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.PureAttribute.#ctor" />
<parameter name="testCode">
<attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
</parameter>
</member>

<member name="T:Xunit.TraitAttribute">
<parameter name="name">
<attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
</parameter>
<parameter name="value">
<attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
</parameter>
</member>

<!-- Utility methods -->
<member name="M:ExceptionExtensions.Unwrap(System.Exception)">
<attribute ctor="M:JetBrains.Annotations.PureAttribute.#ctor" />
<parameter name="ex">
<attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
</parameter>
</member>

<!-- Guard methods -->
<member name="M:Guard.ArgumentNotNull(System.String,System.Object)">
<attribute ctor="M:JetBrains.Annotations.AssertionMethodAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.ContractAnnotationAttribute.#ctor(System.String)">
<argument>argValue:null =&gt; halt</argument>
</attribute>
<parameter name="argName">
<attribute ctor="M:JetBrains.Annotations.InvokerParameterNameAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
</parameter>
<parameter name="argValue">
<attribute
ctor="M:JetBrains.Annotations.AssertionConditionAttribute.#ctor(JetBrains.Annotations.AssertionConditionType)">
<argument>IS_NOT_NULL</argument>
</attribute>
</parameter>
</member>

<member name="M:Guard.ArgumentNotNullOrEmpty(System.String,System.Collections.IEnumerable)">
<attribute ctor="M:JetBrains.Annotations.AssertionMethodAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.ContractAnnotationAttribute.#ctor(System.String)">
<argument>argValue:null =&gt; halt</argument>
</attribute>
<parameter name="argName">
<attribute ctor="M:JetBrains.Annotations.InvokerParameterNameAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
</parameter>
<parameter name="argValue">
<attribute ctor="M:JetBrains.Annotations.InstantHandleAttribute.#ctor" />
<attribute
ctor="M:JetBrains.Annotations.AssertionConditionAttribute.#ctor(JetBrains.Annotations.AssertionConditionType)">
<argument>IS_NOT_NULL</argument>
</attribute>

</parameter>
</member>

<member name="M:Guard.ArgumentValid(System.String,System.String,System.Boolean)">
<attribute ctor="M:JetBrains.Annotations.AssertionMethodAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.ContractAnnotationAttribute.#ctor(System.String)">
<argument>test:false =&gt; halt</argument>
</attribute>
<parameter name="argName">
<attribute ctor="M:JetBrains.Annotations.InvokerParameterNameAttribute.#ctor" />
<attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
</parameter>
<parameter name="message">
<attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
</parameter>
<parameter name="test">
<attribute
ctor="M:JetBrains.Annotations.AssertionConditionAttribute.#ctor(JetBrains.Annotations.AssertionConditionType)">
<argument>IS_TRUE</argument>
</attribute>
</parameter>
</member>
</assembly>
1 change: 1 addition & 0 deletions resharper/nuget/pack-rs91.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nuget pack xunitcontrib-rs91.nuspec
1 change: 1 addition & 0 deletions resharper/nuget/pack-rs92.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nuget pack xunitcontrib-rs92.nuspec
36 changes: 13 additions & 23 deletions resharper/nuget/xunitcontrib-rs9.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,31 @@
<metadata>
<id>CitizenMatt.Xunit</id>
<title>xUnit.net Test Support for ReSharper 9</title>
<version>2.0.6-alpha-20150318</version>
<version>2.0.7</version>
<authors>Matt Ellis</authors>
<owners>Matt Ellis</owners>
<description>A unit test provider for xUnit.net. Discovers and runs xUnit.net 1.x and 2.0 tests. Includes annotations to aid ReSharper inspections and Live Templates to speed up inserting test methods and asserts.</description>
<summary>A unit test provider for xUnit.net</summary>
<releaseNotes>
&#8226; Added logging for ReSharper 9.0
<releaseNotes>Don't crash if we get badly formatted exception data from xunit1 (#50)

From 2.0.5:
&#8226; Support for xunit 2.0 RTM.
From previous builds:
&#8226; Rewritten the core runner to be more robust with multi-threading. Should fix issues with aborted or inconclusive tests (#44, #31)
&#8226; Updated external annotations for xunit 2.0 (#30)
&#8226; Read xunit 2.0 settings from config file (#40)
&#8226; Added logging for ReSharper 9 in internal mode

From 2.0.4:
&#8226; Support for RC4 (build 2924)

From 2.0.3:
&#8226; Support for RC3 (build 2880)
&#8226; Support for xunit's appSettings config
From previous builds:
&#8226; Report diagnostic messages when 'xunit.diagnosticMessages' is set in config (#28)

From 2.0.2:
&#8226; Support for RC1 (build 2826)
&#8226; Report mismatched pre-release versions on failure (#23)
&#8226; Improved compatibility with ReSharper 9
&#8226; Fixed crash working with xUnit.net 1.1

From 2.0.1:
&#8226; Fixed an issue (#9) to run individual methods, rather than all methods in the class
&#8226; Fixed an issue (#21) with Unicode characters in display names and data attributes

From 2.0.0:
&#8226; Beta 5 support (build 2785)
&#8226; Captures output from ITestOutputHelper
&#8226; Shadow copy cache clean up on abort
&#8226; Parallelisation re-enabled!

Known issues:
&#8226; REQUIRES xunit 2.0 RTM. Will NOT run earlier pre-release versions
&#8226; External annotations not yet implemented for xunit2 (to be fixed)
&#8226; Live Templates for Theory use xunit1 namespace (to be fixed)</releaseNotes>
&#8226; Live Templates for Theory use xunit1 namespace</releaseNotes>
<projectUrl>https://github.com/xunit/resharper-xunit</projectUrl>
<licenseUrl>https://raw.githubusercontent.com/xunit/resharper-xunit/xunit2/license.txt</licenseUrl>
<iconUrl>https://raw.githubusercontent.com/xunit/media/master/logo-512-transparent.png</iconUrl>
Expand Down Expand Up @@ -70,5 +56,9 @@ Known issues:
target="DotFiles\Extensions\CitizenMatt.Xunit\settings\templates.dotSettings" />
<file src="..\ExternalAnnotations\xunit.xml"
target="DotFiles\Extensions\CitizenMatt.Xunit\annotations\xunit.xml" />
<file src="..\ExternalAnnotations\xunit.assert.xml"
target="DotFiles\Extensions\CitizenMatt.Xunit\annotations\xunit.assert.xml" />
<file src="..\ExternalAnnotations\xunit.core.xml"
target="DotFiles\Extensions\CitizenMatt.Xunit\annotations\xunit.core.xml" />
</files>
</package>
64 changes: 64 additions & 0 deletions resharper/nuget/xunitcontrib-rs91.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>CitizenMatt.Xunit</id>
<title>xUnit.net Test Support for ReSharper 9</title>
<version>2.1.7</version>
<authors>Matt Ellis</authors>
<owners>Matt Ellis</owners>
<description>A unit test provider for xUnit.net. Discovers and runs xUnit.net 1.x and 2.0 tests. Includes annotations to aid ReSharper inspections and Live Templates to speed up inserting test methods and asserts.</description>
<summary>A unit test provider for xUnit.net</summary>
<releaseNotes>Don't crash if we get badly formatted exception data from xunit1 (#50)

From previous builds:
&#8226; Support for ReSharper 9.1
&#8226; Support for xunit 2.0
&#8226; Rewritten the core runner to be more robust with multi-threading. Should fix issues with aborted or inconclusive tests (#44, #31)
&#8226; Updated external annotations for xunit 2.0 (#30)
&#8226; Read xunit 2.0 settings from config file (#40)
&#8226; Added logging for ReSharper 9 in internal mode
&#8226; Report diagnostic messages when 'xunit.diagnosticMessages' is set in config (#28)
&#8226; Report mismatched pre-release versions on failure (#23)
&#8226; Fixed crash working with xUnit.net 1.1
&#8226; Fixed an issue (#9) to run individual methods, rather than all methods in the class
&#8226; Fixed an issue (#21) with Unicode characters in display names and data attributes
&#8226; Captures output from ITestOutputHelper
&#8226; Shadow copy cache clean up on abort
&#8226; Parallelisation re-enabled!

Known issues:
&#8226; Live Templates for Theory use xunit1 namespace</releaseNotes>
<projectUrl>https://github.com/xunit/resharper-xunit</projectUrl>
<licenseUrl>https://raw.githubusercontent.com/xunit/resharper-xunit/xunit2/license.txt</licenseUrl>
<iconUrl>https://raw.githubusercontent.com/xunit/media/master/logo-512-transparent.png</iconUrl>
<copyright>Copyright 2014 Matt Ellis</copyright>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<dependencies>
<dependency id="Wave" version="[2.0]" />
</dependencies>
<tags>resharper unittest xunit</tags>
</metadata>
<files>
<!-- Plugin -->
<file src="..\src\provider\bin\rs91\Release\xunitcontrib.runner.resharper.provider.9.1.dll"
target="DotFiles" />
<file src="..\src\provider\bin\rs91\Release\xunitcontrib.runner.resharper.runner.9.1.dll"
target="DotFiles" />
<file src="..\src\provider\bin\rs91\Release\xunit.dll"
target="DotFiles" />
<file src="..\src\provider\bin\rs91\Release\xunit.abstractions.dll"
target="DotFiles" />
<file src="..\src\provider\bin\rs91\Release\xunit.runner.utility.desktop.dll"
target="DotFiles" />

<!-- Settings and annotations -->
<file src="..\src\provider\templates.dotSettings"
target="DotFiles\Extensions\CitizenMatt.Xunit\settings\templates.dotSettings" />
<file src="..\ExternalAnnotations\xunit.xml"
target="DotFiles\Extensions\CitizenMatt.Xunit\annotations\xunit.xml" />
<file src="..\ExternalAnnotations\xunit.assert.xml"
target="DotFiles\Extensions\CitizenMatt.Xunit\annotations\xunit.assert.xml" />
<file src="..\ExternalAnnotations\xunit.core.xml"
target="DotFiles\Extensions\CitizenMatt.Xunit\annotations\xunit.core.xml" />
</files>
</package>
67 changes: 67 additions & 0 deletions resharper/nuget/xunitcontrib-rs92.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>CitizenMatt.Xunit</id>
<title>xUnit.net Test Support for ReSharper 9</title>
<version>2.2.9</version>
<authors>Matt Ellis</authors>
<owners>Matt Ellis</owners>
<description>A unit test provider for xUnit.net. Discovers and runs xUnit.net 1.x and 2.0 tests. Includes annotations to aid ReSharper inspections and Live Templates to speed up inserting test methods and asserts.</description>
<summary>A unit test provider for xUnit.net</summary>
<releaseNotes>
&#8226; Find tests in static classes (#46)

From previous builds:
&#8226; Support for ReSharper 9.2 (#63)
&#8226; Assert.IsType and Assert.IsAssignableFrom are no longer marked as pure methods (#69)
&#8226; Don't crash if we get badly formatted exception data from xunit1 (#50)
&#8226; Support for xunit 2.0
&#8226; Rewritten the core runner to be more robust with multi-threading. Should fix issues with aborted or inconclusive tests (#44, #31)
&#8226; Updated external annotations for xunit 2.0 (#30)
&#8226; Read xunit 2.0 settings from config file (#40)
&#8226; Added logging for ReSharper 9 in internal mode
&#8226; Report diagnostic messages when 'xunit.diagnosticMessages' is set in config (#28)
&#8226; Report mismatched pre-release versions on failure (#23)
&#8226; Fixed crash working with xUnit.net 1.1
&#8226; Fixed an issue (#9) to run individual methods, rather than all methods in the class
&#8226; Fixed an issue (#21) with Unicode characters in display names and data attributes
&#8226; Captures output from ITestOutputHelper
&#8226; Shadow copy cache clean up on abort
&#8226; Parallelisation re-enabled!

Known issues:
&#8226; Live Templates for Theory use xunit1 namespace</releaseNotes>
<projectUrl>https://github.com/xunit/resharper-xunit</projectUrl>
<licenseUrl>https://raw.githubusercontent.com/xunit/resharper-xunit/xunit2/license.txt</licenseUrl>
<iconUrl>https://raw.githubusercontent.com/xunit/media/master/logo-512-transparent.png</iconUrl>
<copyright>Copyright 2014 Matt Ellis</copyright>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<dependencies>
<dependency id="Wave" version="[3.0]" />
</dependencies>
<tags>resharper unittest xunit</tags>
</metadata>
<files>
<!-- Plugin -->
<file src="..\src\provider\bin\rs92\Release\xunitcontrib.runner.resharper.provider.9.2.dll"
target="DotFiles" />
<file src="..\src\provider\bin\rs92\Release\xunitcontrib.runner.resharper.runner.9.2.dll"
target="DotFiles" />
<file src="..\src\provider\bin\rs92\Release\xunit.dll"
target="DotFiles" />
<file src="..\src\provider\bin\rs92\Release\xunit.abstractions.dll"
target="DotFiles" />
<file src="..\src\provider\bin\rs92\Release\xunit.runner.utility.desktop.dll"
target="DotFiles" />

<!-- Settings and annotations -->
<file src="..\src\provider\templates.dotSettings"
target="DotFiles\Extensions\CitizenMatt.Xunit\settings\templates.dotSettings" />
<file src="..\ExternalAnnotations\xunit.xml"
target="DotFiles\Extensions\CitizenMatt.Xunit\annotations\xunit.xml" />
<file src="..\ExternalAnnotations\xunit.assert.xml"
target="DotFiles\Extensions\CitizenMatt.Xunit\annotations\xunit.assert.xml" />
<file src="..\ExternalAnnotations\xunit.core.xml"
target="DotFiles\Extensions\CitizenMatt.Xunit\annotations\xunit.core.xml" />
</files>
</package>
Loading