BbQ.MockLite.AutoFixture
2.0.1
dotnet add package BbQ.MockLite.AutoFixture --version 2.0.1
NuGet\Install-Package BbQ.MockLite.AutoFixture -Version 2.0.1
<PackageReference Include="BbQ.MockLite.AutoFixture" Version="2.0.1" />
<PackageVersion Include="BbQ.MockLite.AutoFixture" Version="2.0.1" />
<PackageReference Include="BbQ.MockLite.AutoFixture" />
paket add BbQ.MockLite.AutoFixture --version 2.0.1
#r "nuget: BbQ.MockLite.AutoFixture, 2.0.1"
#:package BbQ.MockLite.AutoFixture@2.0.1
#addin nuget:?package=BbQ.MockLite.AutoFixture&version=2.0.1
#tool nuget:?package=BbQ.MockLite.AutoFixture&version=2.0.1
MockLite with AutoFixture
Freeze a mock before creating the service under test. AutoFixture then uses that same instance whenever it needs the dependency.
using AutoFixture;
using BbQ.MockLite;
using BbQ.MockLite.AutoFixture;
var fixture = new Fixture();
var repository = fixture.FreezeMock<IUserRepository, MockUserRepository>();
repository.SetupGetUser(id => id == "123").Returns(expectedUser);
var service = fixture.Create<UserService>();
Generate MockUserRepository with [GenerateMock<IUserRepository>] and
BbQ.MockLite.Generators. The extension returns the concrete type so its
generated setup and verification methods are available in IntelliSense.
For an interface without a generated mock, use the runtime overload.
var repository = fixture.FreezeMock<IUserRepository>();
repository.Setup(x => x.GetUser("123")).Returns(expectedUser);
var service = fixture.Create<UserService>();
Each fixture owns its registrations. Repeating the same freeze returns the existing mock, including its setups and call history. A different MockLite registration for either of the same types throws. Use a fresh fixture per test, and avoid adding fixture customizations that shadow a frozen type. Freezing affects subsequent requests, including constructor dependencies.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
-
net10.0
- AutoFixture (>= 4.18.1)
- BbQ.MockLite (>= 2.0.1)
-
net8.0
- AutoFixture (>= 4.18.1)
- BbQ.MockLite (>= 2.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 |
|---|---|---|
| 2.0.1 | 54 | 11/19/2026 |