PostSharp.Testing.AspectTesting
2027.0.5-preview
Prefix Reserved
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
<PackageReference Include="PostSharp.Testing.AspectTesting" Version="2027.0.5-preview" />
<PackageVersion Include="PostSharp.Testing.AspectTesting" Version="2027.0.5-preview" />
<PackageReference Include="PostSharp.Testing.AspectTesting" />
paket add PostSharp.Testing.AspectTesting --version 2027.0.5-preview
#r "nuget: PostSharp.Testing.AspectTesting, 2027.0.5-preview"
#:package PostSharp.Testing.AspectTesting@2027.0.5-preview
#addin nuget:?package=PostSharp.Testing.AspectTesting&version=2027.0.5-preview&prerelease
#tool nuget:?package=PostSharp.Testing.AspectTesting&version=2027.0.5-preview&prerelease
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 | Versions 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. |
-
.NETFramework 4.7.2
- Microsoft.CodeAnalysis.CSharp (>= 5.0.0)
- Microsoft.CodeAnalysis.VisualBasic (>= 5.0.0)
- Microsoft.ILVerification (>= 10.0.0)
- PostSharp (>= 2027.0.5-preview)
- System.Memory (>= 4.6.3)
- System.Text.Json (>= 8.0.5)
- xunit.v3.assert (>= 4.0.1)
- xunit.v3.extensibility.core (>= 4.0.1)
-
net10.0
- Microsoft.Build.Utilities.Core (>= 17.6.3)
- Microsoft.ILVerification (>= 10.0.0)
- PostSharp (>= 2027.0.5-preview)
- System.Management (>= 8.0.0)
- xunit.v3.assert (>= 4.0.1)
- xunit.v3.extensibility.core (>= 4.0.1)
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 |