Skip to content

Commit

Permalink
Document xunit v3 migration path
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Dec 24, 2024
1 parent 4c6dfcd commit 2684235
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 47 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Xunit.SkippableFact
This project allows for Xunit tests that can determine during execution that they should report a "skipped" result.
This can be useful when a precondition is not satisfied, or the test is over functionality that does not exist on the platform being tested.

This package targets Xunit v2.
Xunit v3 has skipping built-in.
See [our Xunit v3 migration doc](https://aarnott.github.io/Xunit.SkippableFact/docs/xunit-v3.html).

## Installation

This project is available as a [NuGet package][NuPkg]
Expand Down
97 changes: 51 additions & 46 deletions docfx/docfx.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,53 @@
{
"metadata": [
{
"src": [
{
"src": "../src/Xunit.SkippableFact",
"files": [
"**/*.csproj"
]
}
],
"dest": "api"
}
],
"build": {
"content": [
{
"files": [
"**/*.{md,yml}"
],
"exclude": [
"_site/**"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"xref": [
"https://learn.microsoft.com/en-us/dotnet/.xrefmap.json"
],
"output": "_site",
"template": [
"default",
"modern"
],
"globalMetadata": {
"_appName": "Xunit.SkippableFact",
"_appTitle": "Xunit.SkippableFact",
"_enableSearch": true,
"pdf": false
}
}
"metadata": [
{
"src": [
{
"src": "../src/Xunit.SkippableFact",
"files": [
"**/*.csproj"
]
}
],
"dest": "api"
}
],
"build": {
"content": [
{
"files": [
"**/*.{md,yml}"
],
"exclude": [
"_site/**"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"xref": [
"https://learn.microsoft.com/en-us/dotnet/.xrefmap.json"
],
"output": "_site",
"template": [
"default",
"modern"
],
"globalMetadata": {
"_appName": "Xunit.SkippableFact",
"_appTitle": "Xunit.SkippableFact",
"_enableSearch": true,
"pdf": false
},
"markdownEngineProperties": {
"markdigExtensions": [
"footnotes"
]
}
}
}
2 changes: 1 addition & 1 deletion docfx/docs/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
href: features.md
- name: Getting Started
href: getting-started.md

- href: xunit-v3.md
16 changes: 16 additions & 0 deletions docfx/docs/xunit-v3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Xunit v3 Migration

Xunit v3 has skipping built-in, so there is no need for Xunit.SkippableFact.
As part of upgrading from Xunit v2 to v3, you should remove your package reference on Xunit.SkippableFact.

The following provides a guide for switching your use of Xunit.SkippableFact to Xunit v3 when you update your Xunit dependency.

Xunit.SkippableFact API | Xunit v3 API
--|--
@Xunit.Skip.If* | Assert.SkipWhen
@Xunit.Skip.IfNot* | Assert.SkipUnless
@Xunit.SkipException | Xunit.Sdk.SkipException
@Xunit.SkippableFactAttribute | Xunit.FactAttribute[^1]
@Xunit.SkippableTheoryAttribute | Xunit.TheoryAttribute[^1]

[^1]: Xunit's built-in attributes are sufficient. Although they lack the ability to take a list of exception types that should produce a Skipped result. This [may come in the future](https://github.com/xunit/xunit/issues/3101).
2 changes: 2 additions & 0 deletions docfx/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
href: docs/
- name: API
href: api/
- name: GitHub
href: https://github.com/AArnott/Xunit.SkippableFact

0 comments on commit 2684235

Please sign in to comment.