swalterlabs - SWalter.Testing 2026.11.16.7
Testing
PM> Install-Package SWalter.Testing -Version 2026.11.16.7 -Source https://www.myget.org/F/swalterlabs/api/v3/index.json
> nuget.exe install SWalter.Testing -Version 2026.11.16.7 -Source https://www.myget.org/F/swalterlabs/api/v3/index.json
> dotnet add package SWalter.Testing --version 2026.11.16.7 --source https://www.myget.org/F/swalterlabs/api/v3/index.json
source https://www.myget.org/F/swalterlabs/api/v3/index.json
nuget SWalter.Testing ~> 2026.11.16.7
Copy to clipboard
> choco install SWalter.Testing --version 2026.11.16.7 --source https://www.myget.org/F/swalterlabs/api/v2
Import-Module PowerShellGet
Register-PSRepository -Name "swalterlabs" -SourceLocation "https://www.myget.org/F/swalterlabs/api/v2"
Install-Module -Name "SWalter.Testing" -RequiredVersion "2026.11.16.7" -Repository "swalterlabs"
Copy to clipboard
SWalter.Testing
Testing utilities, AutoFixture extensions, custom assertions, and AwesomeAssertions extensions for .NET and Microsoft.Extensions.DependencyInjection.
📈 Quality & Activity
| Branch | Status & Activity |
|---|---|
📦 Packages in this Repository
| Package | Description | Sources |
|---|---|---|
SWalter.Testing |
AutoFixture custom data attributes, GuardClause assertions, and DI assertion extensions. |
🚀 Package Feeds
All packages (Release and Preview builds) are published to MyGet and Codeberg. You only need to configure one of these feeds.
| Registry | Feed URL |
|---|---|
| MyGet | https://www.myget.org/F/swalterlabs/api/v3/index.json |
| Codeberg | https://codeberg.org/api/packages/evilbaschdi/nuget/index.json |
Add Feed via .NET CLI
Choose either MyGet or Codeberg:
# Option A: MyGet (recommended)
dotnet nuget add source https://www.myget.org/F/swalterlabs/api/v3/index.json -n "SWalter Labs"
# Option B: Codeberg
dotnet nuget add source https://codeberg.org/api/packages/evilbaschdi/nuget/index.json -n "EvilBaschdi Codeberg"
Sample NuGet.Config with Package Source Mapping
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="SWalter Labs" value="https://www.myget.org/F/swalterlabs/api/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<packageSource key="SWalter Labs">
<package pattern="SWalter.*" />
</packageSource>
</packageSourceMapping>
</configuration>
📥 Installation
Install any package via dotnet add package:
Standard Release
dotnet add package SWalter.Testing
Preview Builds
dotnet add package SWalter.Testing --prerelease
💡 Features & Usage
AutoFixture Attributes
NSubstituteOmitAutoPropertiesTrueAutoDataAttribute
A custom xUnit [Theory] attribute combining AutoFixture's AutoDataAttribute with NSubstitute automatic mocking and OmitAutoProperties = true.
using SWalter.Testing;
using Xunit;
[Theory, NSubstituteOmitAutoPropertiesTrueAutoData]
public void MyTest(IMyService service, MyDependency dependency)
{
// service and dependency are automatically created and injected
// properties are not auto-populated - configure them as needed
}
NSubstituteOmitAutoPropertiesTrueInlineAutoDataAttribute
Combines InlineAutoDataAttribute with NSubstitute automatic mocking and OmitAutoProperties = true.
using SWalter.Testing;
using Xunit;
[Theory]
[NSubstituteOmitAutoPropertiesTrueInlineAutoData("value1", 42)]
public void MyTest(string inlineValue, int inlineNumber, IMyService service)
{
// inlineValue and inlineNumber come from the attribute parameters
// service is automatically created by the fixture
}
Guard Clause Assertions
Verifies that public asynchronous methods on a type have proper null guards for reference parameters:
using SWalter.Testing.Extensions;
using AutoFixture.Xunit3;
[Theory, NSubstituteOmitAutoPropertiesTrueAutoData]
public void VerifyAllAsyncMethodsHaveNullGuards(GuardClauseAssertion assertion)
{
assertion.VerifyTask<MyAsyncService>(
typeof(MyAsyncService).GetMethods(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance));
}
Assertions for Microsoft.Extensions.DependencyInjection
Assert service registrations with lifetime and implementation validations:
using SWalter.Testing;
using AwesomeAssertions;
using Microsoft.Extensions.DependencyInjection;
using SWalter.Testing.Assertions.Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddSingleton<ISomeService, SomeService>();
services.AddTransient<ITransient, Transient>();
services.AddScoped<IScoped, Scoped>();
// Assert registration, implementation, and lifetime
services.Should()
.HaveService<ISomeService>()
.WithImplementation<SomeService>()
.AsSingleton();
-
.NETFramework 10.0
- AutoFixture.AutoNSubstitute (>= 5.0.0-rc.1)
- AutoFixture.Idioms (>= 5.0.0-rc.1)
- AutoFixture.Xunit3 (>= 5.0.0-rc.1)
- AwesomeAssertions (>= 9.6.0)
- coverlet.MTP (>= 10.1.1)
- Microsoft.NET.Test.Sdk (>= 18.12.0)
- Microsoft.Testing.Extensions.CodeCoverage (>= 18.12.0)
- Microsoft.Testing.Extensions.TrxReport (>= 2.5.3)
- NCrunch.Framework (>= 5.11.0)
- NSubstitute (>= 6.2.0)
- xunit.v3 (>= 4.0.3)
- xunit.v3.extensibility.core (>= 4.0.3)
- xunit.v3.runner.utility (>= 4.0.3)
-
.NETFramework 11.0
- AutoFixture.AutoNSubstitute (>= 5.0.0-rc.1)
- AutoFixture.Idioms (>= 5.0.0-rc.1)
- AutoFixture.Xunit3 (>= 5.0.0-rc.1)
- AwesomeAssertions (>= 9.6.0)
- coverlet.MTP (>= 10.1.1)
- Microsoft.NET.Test.Sdk (>= 18.12.0)
- Microsoft.Testing.Extensions.CodeCoverage (>= 18.12.0)
- Microsoft.Testing.Extensions.TrxReport (>= 2.5.3)
- NCrunch.Framework (>= 5.11.0)
- NSubstitute (>= 6.2.0)
- xunit.v3 (>= 4.0.3)
- xunit.v3.extensibility.core (>= 4.0.3)
- xunit.v3.runner.utility (>= 4.0.3)
- .NETFramework 10.0: 10.0.0.0
- .NETFramework 11.0: 11.0.0.0
Ownersevilbaschdi |
AuthorsSebastian Walter |
Project URLhttps://github.com/swalterlabs/SWalter.Testing |
LicenseUnknown |
TagsTesting |
Info4 total downloads |
| 0 downloads for version 2026.11.16.7 |
| Download (48.74 KB) |
| Found on the current feed only |
Package history
| Version | Size | Last updated | Downloads | Mirrored? | |||
|---|---|---|---|---|---|---|---|
|
|
2026.11.16.7 | 48.74 KB | Mon, 16 Nov 2026 07:47:53 GMT | 0 |
|
||
|
|
2026.11.16.7-develop | 48.74 KB | Mon, 16 Nov 2026 07:39:10 GMT | 0 |
|
||
|
|
2026.11.11.18 | 49.05 KB | Wed, 11 Nov 2026 18:01:21 GMT | 1 |
|
||
|
|
2026.11.11.17-develop | 48.97 KB | Wed, 11 Nov 2026 17:52:36 GMT | 1 |
|
||
|
|
2026.11.10.17 | 49.07 KB | Tue, 10 Nov 2026 17:34:34 GMT | 1 |
|
||
|
|
2026.11.10.17-develop | 48.93 KB | Tue, 10 Nov 2026 17:22:46 GMT | 1 |
|