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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Testing.Autofac
Small testing library for autofac modules
Nuget
NSubstitute: https://www.nuget.org/packages/Testing.Autofac.NSubstitute/
Moq: https://www.nuget.org/packages/Testing.Autofac.Moq/
Usage
- Create TestContainerBuilder
- Register autofac modules
- Register mocks (NSubstitute or Moq)
- Resolve test services
Usage example (NSubstitute)
[TestMethod]
public void ExampleTest()
{
// arrange
new TestContainerBuilder()
.Module<TestModule>()
.Mock(out IBar bar)
.Resolve(out IFoo underTest);
bar.Value().Returns(2);
// act
var actual = underTest.Add(1);
// assert
Assert.AreEqual(3, actual);
}
Product | Versions 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 |
---|---|
Testing.Autofac.NSubstitute
Small testing library for autofac modules |
|
Testing.Autofac.Moq
Small testing library for autofac modules |
GitHub repositories
This package is not used by any popular GitHub repositories.