-
Notifications
You must be signed in to change notification settings - Fork 1
Framework Integration Guides
Each framework has a complete, step-by-step integration guide. The sections below summarise the key concepts for each; follow the links for the full walkthrough.
Full guide: Integration xUnit3
The simplest integration path. Uses xUnit v3 collection fixtures to manage the test lifecycle.
Key components:
-
DiagrammedTestRun— Base class for collection fixture; tracksStartRunTime/EndRunTimeand holds aConcurrentQueue<ITestContext> -
DiagrammedComponentTest— Base class for test classes; automatically enqueuesTestContext.Currenton dispose -
XUnitReportGenerator.CreateStandardReportsWithDiagrams()— Generates all three report files -
[HappyPath]and[Endpoint("/path")]attributes for test metadata
Full guide: Integration xUnit2
Same pattern as xUnit v3 but adapted for xUnit v2, which lacks TestContext.Current. Uses AsyncLocal<T> and a custom XunitTestFramework for test identity tracking and report generation.
Key components:
-
ReportingTestFramework— CustomXunitTestFrameworkthat generates reports after all tests complete and captures test results via a message sink wrapper -
DiagrammedTestRun— Base class for collection fixture; tracks timing and configuresReportLifecycle.Options -
DiagrammedComponentTest— Base class for test classes; applies[TestTracking](aBeforeAfterTestAttributethat setsAsyncLocalidentity) -
XUnit2ReportGenerator.CreateStandardReportsWithDiagrams()— Generates all three report files -
[HappyPath]and[Endpoint("/path")]attributes (usingITraitAttribute+ITraitDiscoverer)
Full guide: Integration NUnit
Uses NUnit 4's [SetUpFixture] for test lifecycle management.
Key components:
-
DiagrammedTestRun— Base class for[SetUpFixture](must be outside any namespace for global fixture) -
DiagrammedComponentTest— Base class for test fixtures; capturesTestContext.CurrentContextin[TearDown] -
NUnitReportGenerator.CreateStandardReportsWithDiagrams()— Generates all three report files -
[HappyPath]and[Endpoint("/path")]attributes (NUnitPropertyAttributebased)
Important: Use
[FixtureLifeCycle(LifeCycle.InstancePerTestCase)]to ensure each test gets a fresh instance.
Full guide: Integration MSTest
Uses MSTest v3's [AssemblyInitialize]/[AssemblyCleanup] for test lifecycle management.
Key components:
-
DiagrammedTestRun— Base class for[TestClass]with[AssemblyInitialize]/[AssemblyCleanup] -
DiagrammedComponentTest— Base class for test classes; usesAsyncLocal<TestContext>for test identity and enqueuesMSTestScenarioInfoon[TestCleanup] -
MSTestReportGenerator.CreateStandardReportsWithDiagrams()— Generates all three report files -
[HappyPath]and[Endpoint("/path")]attributes
Note: MSTest's
TestContextis instance-based (not static like NUnit/xUnit v3), so the library usesAsyncLocalinternally to make it available to the HTTP tracking pipeline.
Full guide: Integration TUnit
Uses TUnit's [Before(Test)]/[After(Test)] hooks and TestContext.Current for test lifecycle management. TUnit uses Microsoft.Testing.Platform (not Microsoft.NET.Test.Sdk).
Key components:
-
DiagrammedTestRun— Base class for assembly-level hooks; tracksStartRunTime/EndRunTimeand holds aConcurrentQueue<TestContext> -
DiagrammedComponentTest— Base class for test classes; uses[After(Test)]to enqueueTestContextfor report collection -
TUnitReportGenerator.CreateStandardReportsWithDiagrams()— Generates all three report files -
[HappyPath]and[Endpoint("/path")]attributes (TUnitCategoryAttributeandPropertyAttributebased)
Note: TUnit test projects require
<OutputType>Exe</OutputType>in the csproj — this is handled automatically by the TUnit meta package.
Full guide: Integration BDDfy xUnit3
BDD with BDDfy's fluent API (this.Given(...).When(...).Then(...).BDDfy()). Diagrams are injected into both the BDDfy native HTML report and the Kronikol reports.
Key components:
-
BDDfyDiagramsConfigurator.Configure()— Must be called before tests run; registers BDDfy processors -
BDDfyScenarioCollector— Thread-safe collector for scenario metadata -
BDDfyReportGenerator.CreateStandardReportsWithDiagrams()— Generates reports with BDD step details - Tags:
"happy-path","endpoint:/path"passed via.WithTags()
Note: For xUnit v3, set
<OutputType>Exe</OutputType>in the test project's csproj.
Full guide: Integration LightBDD xUnit2
BDD with LightBDD's C# scenario runner (Runner.RunScenarioAsync(given => ..., when => ..., then => ...)). Uses xUnit v2.
Key components:
-
ReportWritersConfiguration.CreateStandardReportsWithDiagrams()— Fluent extension for LightBDD's report writer pipeline -
LightBddTestTrackingMessageHandlerOptions— Auto-fetches test info fromScenarioExecutionContext -
LightBddDiagramsFetcher— Wraps diagrams with LightBDD'sDiagramAsCodetype
Note: Requires
[assembly: ClassCollectionBehavior(AllowTestParallelization = false)].
Full guide: Integration LightBDD xUnit3
BDD with LightBDD's C# scenario runner (Runner.RunScenarioAsync(given => ..., when => ..., then => ...)). Uses xUnit v3.
Key components:
-
LightBddConfiguration.CreateStandardReportsWithDiagrams()— Extension onLightBddConfigurationthat hooks into the report pipeline and registers automatic raw argument capture for rich sub-table rendering of complex objects. -
ReportWritersConfiguration.CreateStandardReportsWithDiagrams()— Legacy overload; hooks into the report pipeline only (no automatic argument capture). -
LightBddTestTrackingMessageHandlerOptions— Auto-fetches test info fromScenarioExecutionContext -
LightBddDiagramsFetcher— Wraps diagrams with LightBDD'sDiagramAsCodetype
Note: Uses
[assembly: TestPipelineStartup(typeof(ConfiguredLightBddScope))]instead of the xUnit v2 scope attribute. Requires<OutputType>Exe</OutputType>in the test project's csproj.
Note: Requires
[assembly: ClassCollectionBehavior(AllowTestParallelization = false)].
Full guide: Integration LightBDD TUnit
BDD with LightBDD's C# scenario runner (Runner.RunScenarioAsync(given => ..., when => ..., then => ...)). Uses TUnit as the test runner.
Key components:
-
ReportWritersConfiguration.CreateStandardReportsWithDiagrams()— Fluent extension for LightBDD's report writer pipeline -
LightBddTestTrackingMessageHandlerOptions— Auto-fetches test info fromScenarioExecutionContext -
LightBddDiagramsFetcher— Wraps diagrams with LightBDD'sDiagramAsCodetype
Note: Uses
[assembly: ConfiguredLightBddScope]with a customLightBddScopeAttributesubclass. Requires<OutputType>Exe</OutputType>in the test project's csproj.
Full guide: Integration ReqNRoll xUnit2
Gherkin-based BDD with .feature files and [Binding] step definitions.
Key components:
-
ReqNRollTrackingHooks— Auto-registered viareqnroll.jsonbinding assembly; captures scenario IDs, steps, and results -
ReqNRollReportGenerator.CreateStandardReportsWithDiagrams()— Generates reports with Gherkin step details -
ReqNRollReportEnhancer— Additionally enhances ReqNRoll's native HTML report with sequence diagram attachments (when thehtmlformatter is enabled inreqnroll.json). The standard custom reports are still generated as before - Tags:
@happy-path,@endpoint:/pathin feature files
Critical: Add to
reqnroll.json:{ "bindingAssemblies": [ { "assembly": "Kronikol.ReqNRoll.xUnit2" } ], "formatters": { "html": { "outputFilePath": "reqnroll_report.html" } } }
Full guide: Integration ReqNRoll xUnit3
Identical to the xUnit v2 variant, but targets the xUnit v3 out-of-process runner.
Key differences from xUnit v2:
- References
Kronikol.ReqNRoll.xUnit3instead ofxUnit2 - Requires
<OutputType>Exe</OutputType>in the test project's csproj -
reqnroll.jsonreferencesKronikol.ReqNRoll.xUnit3
ReqNRoll HTML report: Both ReqNRoll packages additionally enhance ReqNRoll's native HTML report with sequence diagrams when the
htmlformatter is enabled inreqnroll.json. This is in addition to the standard custom reports that are always generated in the Reports directory. See the Integration ReqNRoll xUnit2 guide for details.
Full guide: Integration ReqNRoll TUnit
Identical to the xUnit v3 variant, but uses TUnit as the test runner via the Reqnroll.TUnit package.
Key differences from xUnit v3:
- References
Kronikol.ReqNRoll.TUnitinstead ofxUnit3 - Uses
Reqnroll.TUnitinstead ofReqnroll.xunit.v3 - Requires
<OutputType>Exe</OutputType>and<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>in the csproj - Must set
<RootNamespace>to avoid namespace collision withTUnit.Core(see guide for details) -
reqnroll.jsonreferencesKronikol.ReqNRoll.TUnit
ReqNRoll HTML report: The ReqNRoll TUnit package additionally enhances ReqNRoll's native HTML report with sequence diagrams when the
htmlformatter is enabled inreqnroll.json. This is in addition to the standard custom reports that are always generated in the Reports directory. See the Integration ReqNRoll xUnit2 guide for details.
Full guide: Integration CosmosDB Extension
The Kronikol.Extensions.CosmosDB package adds Cosmos DB SDK operation tracking. Instead of raw HTTP methods and _rid-encoded URLs, your diagrams show classified operations like Create Document [orders], Query [orders]: SELECT * FROM c WHERE ..., etc.
Key components:
-
CosmosTrackingMessageHandler—DelegatingHandlerthat classifies Cosmos SDK HTTP traffic and logs toRequestResponseLogger -
CosmosTrackingMessageHandlerOptions— Service names, verbosity level (Raw/Detailed/Summarised), test info fetcher -
CosmosClientOptionsExtensions.WithTestTracking()— Extension method onCosmosClientOptionsfor easy wiring
Works with any test framework and integrates with CosmosDB.InMemoryEmulator via WithHttpMessageHandlerWrapper.
Full guide: Integration EF Core Relational Extension
The Kronikol.Extensions.EfCore.Relational package adds EF Core SQL operation tracking. Instead of seeing nothing (EF Core bypasses HttpMessageHandler entirely), your diagrams show classified operations like Select: /ordersdb/Users, Insert: /ordersdb/Orders, StoredProc: /ordersdb/GetReport, etc.
Key components:
-
SqlTrackingInterceptor—DbCommandInterceptorthat classifies SQL commands and logs toRequestResponseLogger -
SqlTrackingInterceptorOptions— Service names, verbosity level (Raw/Detailed/Summarised), test info fetcher -
DbContextOptionsBuilderExtensions.WithSqlTestTracking()— Extension method onDbContextOptionsBuilderfor easy wiring -
SqlOperationClassifier— Static classifier that handles all SQL dialects (SQL Server, PostgreSQL, MySQL, SQLite, Oracle, Spanner)
Works with any test framework and any EF Core relational provider.
Full guide: Integration Redis Extension
The Kronikol.Extensions.Redis package adds StackExchange.Redis operation tracking with cache hit/miss visualization. Instead of invisible Redis operations, your diagrams show classified operations like Get (Hit): redis://db0/user:123, Set: redis://db0/session:abc, HashGet (Miss): redis://db0/cart:456, etc.
Key components:
-
RedisTrackingDatabase—DispatchProxy-basedIDatabasedecorator that intercepts Redis operations and logs toRequestResponseLogger -
RedisTrackingDatabaseOptions— Service names, verbosity level (Raw/Detailed/Summarised), test info fetcher -
DatabaseExtensions.WithRedisTestTracking()— Extension method onIDatabasefor easy wiring -
DatabaseExtensions.GetTrackedDatabase()— Extension method onIConnectionMultiplexerfor easy wiring -
RedisOperationClassifier— Static classifier with cache hit/miss detection for read operations
Works with any test framework. Uses DispatchProxy because StackExchange.Redis has no built-in interception infrastructure.
Getting Started
Common Tasks
Integration Guides
- Integration xUnit3
- Integration xUnit2
- Integration NUnit
- Integration MSTest
- Integration TUnit
- Integration BDDfy xUnit3
- Integration LightBDD xUnit2
- Integration LightBDD xUnit3
- Integration LightBDD TUnit
- Integration ReqNRoll xUnit2
- Integration ReqNRoll xUnit3
- Integration ReqNRoll TUnit
Extensions
- Integration AtlasDataApi Extension
- Integration BigQuery Extension
- Integration Bigtable Extension
- Integration BlobStorage Extension
- Integration CloudStorage Extension
- Integration CosmosDB Extension
- Integration Dapper Extension
- Integration DynamoDB Extension
- Integration EF Core Relational Extension
- Integration Elasticsearch Extension
- Integration EventBridge Extension
- Integration EventHubs Extension
- Integration Grpc Extension
- Integration Kafka Extension
- Integration MassTransit Extension
- Integration MongoDB Extension
- Integration MySqlConnector Extension
- Integration Npgsql Extension
- Integration Oracle Extension
- Integration PubSub Extension
- Integration Redis Extension
- Integration S3 Extension
- Integration ServiceBus Extension
- Integration SNS Extension
- Integration Spanner Extension
- Integration SqlClient Extension
- Integration Sqlite Extension
- Integration SQS Extension
- Integration StorageQueues Extension
- Integration OpenTelemetry Extension
- Integration DispatchProxy Extension
- Integration MediatR Extension
- Integration PlantUML IKVM
Configuration
- Tracking Dependencies
- Tracking Custom Dependencies
- HTTP Tracking Setup
- Report Configuration
- Diagram Customisation
- Phase-Aware Tracking
- Content Formatting
- PlantUML Server Configuration
Features
- Generated Reports
- Search Syntax
- Component Diagrams
- PlantUML Browser Rendering
- Inline SVG Rendering
- Internal Flow Tracking
- Tags and Attributes
- Excluding Requests
- Excluded Headers
- Multi-Host Test Architectures
- Event-Driven Architecture Testing
- Service Bus Tracking Patterns
- Background Thread Correlation
- Parallel-Safe Background Correlation
- Event & Message Tracking
- Assertion Tracking
- Step Tracking
- Tabular Attributes
- Large Response and Diagram Handling
- Diagnostics and Debugging
- CI Summary Integration
- CI Artifact Upload
Reference