Ploch.TestingSupport.XUnit2.Dependencies
Legacy meta-package: single reference for xUnit v2 test dependencies in older projects.
Overview
Ploch.TestingSupport.XUnit2.Dependencies is a meta-package for test projects that have not yet been migrated to xUnit v3. Like its xUnit v3 counterpart, it carries no compilable source and exists only to bundle a curated set of testing packages under a single project reference.
It targets net6.0 with SuppressTfmSupportBuildErrors=true, which allowed it to be consumed by projects on older target frameworks during the workspace's migration period.
New test projects should use Ploch.TestingSupport.XUnit3.Dependencies instead. xUnit v2 is no longer actively maintained and receives only critical fixes.
Bundled Packages
| Package | Notes |
|---|---|
xunit |
xUnit v2 test framework |
xunit.analyzers |
Roslyn analyser for xUnit best practices |
xunit.runner.visualstudio |
Visual Studio test runner adapter |
Xunit.SkippableFact |
Allows [SkippableFact] and [SkippableTheory] for runtime skip conditions |
FluentAssertions |
Fluent assertion library |
FluentAssertions.Analyzers |
Roslyn analyser for FluentAssertions usage |
Microsoft.NET.Test.Sdk |
MSBuild/dotnet test integration |
coverlet.msbuild |
Code coverage collection via MSBuild |
Installation
<ItemGroup>
<ProjectReference Include="..\..\..\ploch-common\src\TestingSupport.XUnit2.Dependencies\Ploch.TestingSupport.XUnit2.Dependencies.csproj" />
</ItemGroup>
Migration
To migrate a test project from xUnit v2 to xUnit v3:
- Replace the reference to
Ploch.TestingSupport.XUnit2.DependencieswithPloch.TestingSupport.XUnit3.Dependencies. - Update the
TargetFrameworktonet8.0or later. - Replace
[SkippableFact]/[SkippableTheory]with the[SupportedOSPlatform]attribute from Ploch.TestingSupport.XUnit3 for OS-conditional skipping, or use xUnit v3's built-inSkipproperty on[Fact]and[Theory]. - Review data attributes — xUnit v3's
ITheoryDataRowAPI differs from v2'sIEnumerable<object[]>.
Related Libraries
- Ploch.TestingSupport.XUnit3.Dependencies — Recommended replacement for new and migrated projects
- Ploch.TestingSupport.XUnit3 — xUnit v3 helpers including the OS-conditional skip attribute