PostSharp.Testing.AspectTesting 2027.0.5-preview

Prefix Reserved
This is a prerelease version of PostSharp.Testing.AspectTesting.

Requires NuGet 2.12 or higher.

dotnet add package PostSharp.Testing.AspectTesting --version 2027.0.5-preview
                    
NuGet\Install-Package PostSharp.Testing.AspectTesting -Version 2027.0.5-preview
                    
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="PostSharp.Testing.AspectTesting" Version="2027.0.5-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PostSharp.Testing.AspectTesting" Version="2027.0.5-preview" />
                    
Directory.Packages.props
<PackageReference Include="PostSharp.Testing.AspectTesting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PostSharp.Testing.AspectTesting --version 2027.0.5-preview
                    
#r "nuget: PostSharp.Testing.AspectTesting, 2027.0.5-preview"
                    
#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.
#:package PostSharp.Testing.AspectTesting@2027.0.5-preview
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PostSharp.Testing.AspectTesting&version=2027.0.5-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PostSharp.Testing.AspectTesting&version=2027.0.5-preview&prerelease
                    
Install as a Cake Tool

A test framework for PostSharp aspects, based on xunit.v3. Each source file of the test project is a test: the framework compiles it, weaves it with PostSharp, verifies the woven assembly, and runs its Main method. A test passes when the weaving reports the expected messages and the program returns 0.

Create an xunit.v3 test project, reference this package, the xunit.v3 package and the packages of your aspects, and add test files to it. The files are not compiled into the test project: the framework compiles each one separately.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="xunit.v3" Version="4.0.1" />
    <PackageReference Include="PostSharp.Testing.AspectTesting" Version="..." />
    <PackageReference Include="MyAspects" Version="..." />
  </ItemGroup>
</Project>

A test file configures its test with directives in comments. For example, // @ExpectedMessage(MY001) expects the message MY001 that your aspect reports when it is misused, // @SkipRuntime weaves and verifies the test without running it, and // @TestRun(Name) runs the test once more under that name. Run the tests as any xunit.v3 test project, with dotnet test or the test executable.

To compare the output of each program and the messages of its build with files next to the test, set PostSharpTestOutputFileSuffix (such as .txt for Foo.txt) and PostSharpTestMessagesFileSuffix (such as .build.txt) in the test project. A missing file stands for an empty result. When a result differs, the test fails and the actual result is written next to the expected file (Foo.actual.txt); run the tests with the environment variable POSTSHARP_TEST_ACCEPT_SNAPSHOTS=true to accept the actual results.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2027.0.5-preview 33 10/16/2026