Dabbler.Platform.Stubs 2.0.2

Prefix Reserved
dotnet add package Dabbler.Platform.Stubs --version 2.0.2
                    
NuGet\Install-Package Dabbler.Platform.Stubs -Version 2.0.2
                    
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="Dabbler.Platform.Stubs" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dabbler.Platform.Stubs" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Dabbler.Platform.Stubs" />
                    
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 Dabbler.Platform.Stubs --version 2.0.2
                    
#r "nuget: Dabbler.Platform.Stubs, 2.0.2"
                    
#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 Dabbler.Platform.Stubs@2.0.2
                    
#: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=Dabbler.Platform.Stubs&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Dabbler.Platform.Stubs&version=2.0.2
                    
Install as a Cake Tool

Dabbler.Platform.Stubs

Part of the Dabbler Platform. See docs/platform-overview.md for the platform-level view of how this library fits in.

Opt-in stub providers for the Dabbler platform surface. Reusable DI-friendly stubs for bUnit tests, demo / stub-app hosts, and early design review when real providers aren't yet wired up.

Audience

Teams who want the same component code to run against both real providers (production) and in-memory stubs (tests, demos, design review) without conditional branches inside the components themselves.

One package. The Components, Reports and Security stub providers all ship in this package, under the Dabbler.Platform.Stubs namespace. It references Dabbler.Reports.Core, and therefore carries DabblerPdf (LGPL/MPL) transitively; see Warnings and caveats.

Prerequisites and stack constraints

  • Blazor Server (matches the platform target)
  • MudBlazor 9.x (transitively via Dabbler.Components)
  • .NET 10 (current LTS)
  • Reference to Dabbler.Components and Dabbler.Reports.Core (both come with the package)

Install

Adoption note: The recommended adoption model for internal projects is integrated source under src/Libs/Dabbler.Platform.Stubs/. To install from NuGet: dotnet add package Dabbler.Platform.Stubs.

Minimal registration

// Build a stub-platform definition
var definition = new StubPlatformDefinition
{
    Entities =
    [
        new EntityMetadata
        {
            EntityName = "Customer",
            DisplayName = "Customers",
            DisplayNameSingular = "Customer",
            ShowInNavigation = true,
        }
    ]
};

// Register the umbrella (or pick focused helpers below)
services.AddDabblerPlatformStubs(definition);

Smallest working example

A bUnit test that wires a stub grid provider for Customer:

[Fact]
public void CustomersGrid_RendersStubRows()
{
    using var ctx = new BunitContext();
    ctx.AddDabblerStubs(StubDefinitions.MinimalCustomer());
    ctx.Services.AddStubGridDataProvider<Customer>(new[]
    {
        new Customer(101, "Ada Lovelace"),
        new Customer(102, "Grace Hopper"),
    });

    var cut = ctx.Render<CustomersGrid>();
    Assert.Contains("Ada Lovelace", cut.Markup);
}

The same CustomersGrid component renders against the real CustomerGridDataProvider in production — no conditional code paths inside the component.

Supported stub surface

Helper Provider
AddDabblerPlatformStubs(definition) Bulk umbrella registration.
AddStubGridDataProvider<T>(rows) IGridDataProvider<T> for grid + query pages.
AddStubComboBoxItemProvider<T>(items) IComboBoxItemProvider<T> for lookups.
AddStubReportDataProvider() IReportDataProvider returning seeded rows + parameter values.
AddStubEntityMetadataProvider(definition) Metadata for DeclarativeFilterPanel + nav.
AddStubNavigationDataProvider(definition) Navigation records for shell-driven hosts.
AddStubArtifactCatalogProvider(items) Optional artifact-catalog state.
AddStubUsageTrackingProvider() Optional usage tracker.
AddStubAuthentication(userContext) AuthenticationStateProvider for role-aware / org-aware test contexts.

The contract: stubs never silently activate

Per ledger §4.2, stub mode is explicit opt-in:

  • No auto-discovery. Referencing the package does not register stubs.
  • No environment-variable shortcut. Stubs never silently take over.
  • No production fallback. If a real provider isn't registered, DI throws — which is the correct failure mode for a production app.

Warnings and caveats

  • DabblerPdf transitive license — non-MIT. Through Dabbler.Reports.Core, this package transitively pulls in DabblerPdf (LGPL-2.1-only OR MPL-2.0).
  • Stubs are not a production posture. Per ledger §4.2, accidental use of stubs in production is prevented by requiring explicit registration — but the package is named "Stubs" for a reason; do not lean on it as a "real provider not implemented yet" stand-in outside of test / demo / design-review contexts.
  • License: MIT (see LICENSE).

If this library stops being maintained

This package is MIT-licensed, and its source is in src/Libs/Dabbler.Platform.Stubs. If it stops being maintained, copy that source into your application, replace the package reference with a project reference to your copy, and own it from there. Keep the MIT license notice with the copied code.

Product Compatible and additional computed target framework versions.
.NET 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
2.0.2 93 11/13/2026
2.0.1 94 11/13/2026
2.0.0 90 11/13/2026
1.0.0 91 11/9/2026
0.1.0-preview.1 99 5/30/2026