swalterlabs - SWalter.Testing 2026.11.11.18

Testing

PM> Install-Package SWalter.Testing -Version 2026.11.11.18 -Source https://www.myget.org/F/swalterlabs/api/v3/index.json

Copy to clipboard

> nuget.exe install SWalter.Testing -Version 2026.11.11.18 -Source https://www.myget.org/F/swalterlabs/api/v3/index.json

Copy to clipboard

> dotnet add package SWalter.Testing --version 2026.11.11.18 --source https://www.myget.org/F/swalterlabs/api/v3/index.json

Copy to clipboard
<PackageReference Include="SWalter.Testing" Version="2026.11.11.18" />
Copy to clipboard
source https://www.myget.org/F/swalterlabs/api/v3/index.json

nuget SWalter.Testing  ~> 2026.11.11.18
Copy to clipboard

> choco install SWalter.Testing --version 2026.11.11.18 --source https://www.myget.org/F/swalterlabs/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "swalterlabs" -SourceLocation "https://www.myget.org/F/swalterlabs/api/v2"
Install-Module -Name "SWalter.Testing" -RequiredVersion "2026.11.11.18" -Repository "swalterlabs" 
Copy to clipboard

SWalter.Testing

License: MIT Target: .NET 10.0

Testing utilities, AutoFixture extensions, custom assertions, and AwesomeAssertions extensions for .NET and Microsoft.Extensions.DependencyInjection.


📈 Quality & Activity

Branch Status & Activity
Main CodeFactor Commit Activity Main Last Commit Main
Develop CodeFactor Commit Activity Develop Last Commit Develop

📦 Packages in this Repository

Package Description Sources
SWalter.Testing AutoFixture custom data attributes, GuardClause assertions, and DI assertion extensions. MyGet Codeberg

🚀 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.0)
    • 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.0)
    • 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

Owners

evilbaschdi

Authors

Sebastian Walter

Project URL

https://github.com/swalterlabs/SWalter.Testing

License

Unknown

Tags

Testing

Info

4 total downloads
1 downloads for version 2026.11.11.18
Download (49.05 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