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
<PackageReference Include="Dabbler.Platform.Stubs" Version="2.0.2" />
<PackageVersion Include="Dabbler.Platform.Stubs" Version="2.0.2" />
<PackageReference Include="Dabbler.Platform.Stubs" />
paket add Dabbler.Platform.Stubs --version 2.0.2
#r "nuget: Dabbler.Platform.Stubs, 2.0.2"
#:package Dabbler.Platform.Stubs@2.0.2
#addin nuget:?package=Dabbler.Platform.Stubs&version=2.0.2
#tool nuget:?package=Dabbler.Platform.Stubs&version=2.0.2
Dabbler.Platform.Stubs
Part of the Dabbler Platform. See
docs/platform-overview.mdfor 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.Stubsnamespace. It referencesDabbler.Reports.Core, and therefore carriesDabblerPdf(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.ComponentsandDabbler.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.
Related packages
Dabbler.Components— the surfaces these stubs back.Dabbler.Reports.Core— backsStubReportDataProvider.Dabbler.Security— backsStubAuthentication.Dabbler.Testing.Blazor— pairs with the stub providers for Playwright watermark synchronization during E2E tests.
Warnings and caveats
- DabblerPdf transitive license — non-MIT. Through
Dabbler.Reports.Core, this package transitively pulls inDabblerPdf(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 | Versions 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. |
-
net10.0
- Dabbler.Components (>= 2.0.2)
- Dabbler.Reports.Core (>= 2.0.2)
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 |