TestInheritanceGenerator 1.1.0

dotnet add package TestInheritanceGenerator --version 1.1.0                
NuGet\Install-Package TestInheritanceGenerator -Version 1.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TestInheritanceGenerator" Version="1.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TestInheritanceGenerator --version 1.1.0                
#r "nuget: TestInheritanceGenerator, 1.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TestInheritanceGenerator as a Cake Addin
#addin nuget:?package=TestInheritanceGenerator&version=1.1.0

// Install TestInheritanceGenerator as a Cake Tool
#tool nuget:?package=TestInheritanceGenerator&version=1.1.0                

InheritedTestsGenerator

Purpose

This source generator package generates test class "stubs" which inherit from test classes in a referenced test project. The typical use case is if you have test projects per version of some software component and you want all tests for the previous version to be executed for the next version as well. This is accomplished automatically by this package by generating a file for each found test class in the referenced test project and by adding inheritance to the original class.

Usage

Add a reference to this nuget package in the package you want to inherit test into and also reference the test project for the previous version.

It is possible to disable inheritance generation for specific test classes by adding an attribute called SkipInheritanceGenerationAttribute. This attribute can be added in the test project where it is needed, as long as it has that specific name. It is also available in a NuGet package called TestInheritanceGenerator.Annotations.

Supported test frameworks

The package has support for the following test frameworks:

  • MSTest
  • xUnit
  • NUnit

Analyzers

The following diagnostics are reported as guidance, if no tests are being generated:

Credits

This work is heavily inspired by a similar source generator implemented by Sam Harwell in StyleCop.Analyzers.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 177 11/28/2024
1.1.0-alpha.1 40 11/28/2024
1.0.0 132 11/24/2024