Testing.Autofac 2.0.1

dotnet add package Testing.Autofac --version 2.0.1
NuGet\Install-Package Testing.Autofac -Version 2.0.1
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="Testing.Autofac" Version="2.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Testing.Autofac --version 2.0.1
#r "nuget: Testing.Autofac, 2.0.1"
#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 Testing.Autofac as a Cake Addin
#addin nuget:?package=Testing.Autofac&version=2.0.1

// Install Testing.Autofac as a Cake Tool
#tool nuget:?package=Testing.Autofac&version=2.0.1


Small testing library for autofac modules


NSubstitute: https://www.nuget.org/packages/Testing.Autofac.NSubstitute/

Moq: https://www.nuget.org/packages/Testing.Autofac.Moq/


  1. Create TestContainerBuilder
  2. Register autofac modules
  3. Register mocks (NSubstitute or Moq)
  4. Resolve test services

Usage example (NSubstitute)

public void ExampleTest()
    // arrange
    new TestContainerBuilder()
        .Mock(out IBar bar)
        .Resolve(out IFoo underTest);


    // act
    var actual = underTest.Add(1);

    // assert
    Assert.AreEqual(3, actual);
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  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 (2)

Showing the top 2 NuGet packages that depend on Testing.Autofac:

Package Downloads

Small testing library for autofac modules


Small testing library for autofac modules

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.1 107 1/17/2024
2.0.0 133 11/30/2023
1.2.8 169 9/11/2023
1.2.7 190 8/17/2023
1.2.6 230 8/9/2023
1.2.5 214 8/8/2023
1.2.4 366 3/9/2023
1.2.3 450 2/12/2023
1.2.2 582 12/22/2022
1.2.1 583 12/9/2022
1.2.0 642 11/30/2022
1.1.1 713 11/29/2022