-
Notifications
You must be signed in to change notification settings - Fork 1
Project Templates
Added in v2.29.17
Kronikol ships a dotnet new template pack containing 12 pre-configured project templates for all supported test frameworks. Each template creates a fully working component test project with:
- HTTP dependency tracking configured
- Report generation with diagrams
-
Assertion tracking pre-configured (via
AssertionTracking) - A sample test/scenario demonstrating the complete workflow
dotnet new install Kronikol.Templates| Short Name | Framework | Description |
|---|---|---|
kronikol-xunit3 |
xUnit v3 | Component tests with xUnit v3 |
kronikol-xunit2 |
xUnit v2 | Component tests with xUnit v2 |
kronikol-tunit |
TUnit | Component tests with TUnit |
kronikol-nunit4 |
NUnit 4 | Component tests with NUnit 4 |
kronikol-mstest |
MSTest | Component tests with MSTest |
kronikol-lightbdd-xunit3 |
LightBDD + xUnit v3 | BDD-style component tests with LightBDD and xUnit v3 |
kronikol-lightbdd-xunit2 |
LightBDD + xUnit v2 | BDD-style component tests with LightBDD and xUnit v2 |
kronikol-lightbdd-tunit |
LightBDD + TUnit | BDD-style component tests with LightBDD and TUnit |
kronikol-bddfy-xunit3 |
BDDfy + xUnit v3 | BDD-style component tests with BDDfy and xUnit v3 |
kronikol-reqnroll-xunit3 |
ReqNRoll + xUnit v3 | Gherkin BDD tests with ReqNRoll and xUnit v3 |
kronikol-reqnroll-xunit2 |
ReqNRoll + xUnit v2 | Gherkin BDD tests with ReqNRoll and xUnit v2 |
kronikol-reqnroll-tunit |
ReqNRoll + TUnit | Gherkin BDD tests with ReqNRoll and TUnit |
# Create an xUnit v3 test project
dotnet new kronikol-xunit3 -n MyApi.Tests.Component
# Create with custom service names
dotnet new kronikol-xunit3 -n MyApi.Tests.Component \
--serviceName "OrderService" \
--downstreamService "PaymentGateway" \
--downstreamPort 15060
# Create a ReqNRoll project targeting .NET 9
dotnet new kronikol-reqnroll-xunit3 -n MyApi.Tests.BDD --Framework net9.0All templates accept these parameters:
| Parameter | Default | Description |
|---|---|---|
--serviceName |
MyApi |
Name of the service under test (used in diagram labels and report titles) |
--downstreamService |
DownstreamService |
Name of a downstream dependency (used in port-to-service mapping) |
--downstreamPort |
15050 |
Port for the downstream service |
--Framework |
net10.0 |
Target framework (net8.0, net9.0, or net10.0) |
Each generated project contains:
| File | Purpose |
|---|---|
*.csproj |
Project file with all required package references |
appsettings.componenttests.json |
Configuration for downstream service URLs |
AssertionTracking.cs |
[assembly: TrackAssertions] opt-in for automatic assertion rewriting |
Infrastructure/BaseFixture.cs |
WebApplicationFactory setup with dependency tracking (xUnit/NUnit/MSTest/TUnit) |
Infrastructure/TestRun.cs |
Report generation on test run completion |
Scenarios/SampleFeature.cs |
Working example test demonstrating assertions + HTTP calls |
Program.cs |
Minimal API host for the service under test |
For ReqNRoll templates, the structure uses Gherkin features:
| File | Purpose |
|---|---|
Features/Sample.feature |
Example Gherkin scenario |
StepDefinitions/SampleStepDefinitions.cs |
Step implementations |
Hooks/TestSetupHooks.cs |
Test lifecycle hooks with Kronikol tracking |
reqnroll.json |
ReqNRoll binding configuration |
-
Add a project reference to your API project:
<ProjectReference Include="..\YourApi\YourApi.csproj" />
-
Update
Program.csto match your actual API startup (or remove it and reference the realProgramclass). -
Configure downstream services in
appsettings.componenttests.json. -
Run the sample test to verify everything works:
dotnet test -
Open the generated report at
bin/Debug/net10.0/Reports/FeaturesReport.html.
v2.37.1: Assertion tracking has been removed from all dotnet templates. IL weaving can interfere with some build configurations, so assertion tracking is now an opt-in beta feature. To enable it manually, add the
Kronikol.AssertionTrackingpackage and anAssertionTracking.csfile as described below.
To opt in to assertion tracking, add the package reference to your .csproj:
<PackageReference Include="Kronikol.AssertionTracking" Version="2.*" />Then create an AssertionTracking.cs file with:
using Kronikol.Tracking;
[assembly: TrackAssertions]This means every .Should() assertion in the project is automatically instrumented at compile time — assertions appear as inline notes in your sequence diagrams with no manual effort. See Assertion Tracking for details.
dotnet new uninstall Kronikol.TemplatesGetting 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 ClickHouse 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
- Merging Parallel Reports
Reference