MVFC.Pack.Testing 4.0.0

dotnet add package MVFC.Pack.Testing --version 4.0.0
                    
NuGet\Install-Package MVFC.Pack.Testing -Version 4.0.0
                    
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="MVFC.Pack.Testing" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MVFC.Pack.Testing" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MVFC.Pack.Testing" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MVFC.Pack.Testing --version 4.0.0
                    
#r "nuget: MVFC.Pack.Testing, 4.0.0"
                    
#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.
#:package MVFC.Pack.Testing@4.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MVFC.Pack.Testing&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MVFC.Pack.Testing&version=4.0.0
                    
Install as a Cake Tool

MVFC.Pack.Testing

🇧🇷 Leia em Português · ← Back to MVFC.Pack

License Platform NuGet Version NuGet Downloads

Metapackage for unit and integration testing — xUnit v3, NSubstitute, Bogus, AutoBogus, FluentAssertions and Testcontainers, all pinned and ready.

Motivation

Writing tests from the first commit requires the same ecosystem every time: a test framework, a mocking library, a fake-data generator, an assertion library with readable failure messages, and a way to spin up real infrastructure (databases, brokers) without managing Docker Compose files manually.

MVFC.Pack.Testing ships all of them, pinned to compatible versions, so your test project is productive from the moment the package is installed.

Installation

dotnet add package MVFC.Pack.Testing

Quick Start

// 1. Unit test with NSubstitute + FluentAssertions
public class OrderServiceTests
{
    private readonly IOrderRepository _repo = Substitute.For<IOrderRepository>();
    private readonly OrderService _sut;

    public OrderServiceTests() => _sut = new OrderService(_repo);

    [Fact]
    public async Task CreateOrder_ShouldReturnId()
    {
        _repo.SaveAsync(Arg.Any<Order>()).Returns(Guid.NewGuid());

        var result = await _sut.CreateAsync(new CreateOrderRequest("Keyboard", 1));

        result.Should().NotBeEmpty();
        await _repo.Received(1).SaveAsync(Arg.Any<Order>());
    }
}

// 2. Fake data with Bogus
var faker = new Faker<Order>()
    .RuleFor(o => o.Id,      f => f.Random.Guid())
    .RuleFor(o => o.Product, f => f.Commerce.ProductName())
    .RuleFor(o => o.Total,   f => f.Finance.Amount());

var orders = faker.Generate(10);

// 3. AutoBogus — generate fully populated objects automatically
var order = AutoFaker.Generate<Order>();

// 4. Integration test with Testcontainers — real MongoDB, no mocks
public class OrderRepositoryTests : IAsyncLifetime
{
    private readonly MongoDbContainer _mongo = new MongoDbBuilder().Build();

    public Task InitializeAsync() => _mongo.StartAsync();
    public Task DisposeAsync()    => _mongo.DisposeAsync().AsTask();

    [Fact]
    public async Task Insert_ShouldPersistOrder()
    {
        var repo = new OrderRepository(_mongo.GetConnectionString());
        var order = AutoFaker.Generate<Order>();

        await repo.InsertAsync(order);
        var found = await repo.GetByIdAsync(order.Id);

        found.Should().NotBeNull();
        found!.Id.Should().Be(order.Id);
    }
}

Included Packages

Package Version
xunit.v3 3.2.2
xunit.v3.extensibility.core 3.2.2
xunit.runner.visualstudio 3.1.5
Microsoft.NET.Test.Sdk 18.0.1
FluentAssertions 7.0.0
NSubstitute 5.3.0
Microsoft.AspNetCore.Mvc.Testing 10.0.3
Bogus 35.6.5
AutoBogus 2.13.1
Testcontainers 4.10.0

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
4.0.0 106 4/8/2026
3.0.3 126 3/20/2026
2.0.1 155 2/23/2026
2.0.0 158 2/23/2026
1.0.3 150 2/23/2026