Getting Started
This guide walks you through installing TrganReport, creating your first report, organizing tests into containers, and generating a polished HTML output. A typical test flow includes initialization, grouping, execution, and final rendering. Read on to explore each step in detail.
Installation
Install via NuGet,
dotnet add package TrganReport
1. Initialize a Report
Import the namespace and create a new TrganHtmlReport
instance, specifying the output path:
using TrganReport;
TrganHtmlReport report = new TrganHtmlReport("reports/TrganReport.html");
2. Organize Tests using TrganContainer
Use TrganContainer
to group related test cases for clarity and modularity:
TrganContainer container = report.CreateContainer(name: "Login Tests");
3. Add Tests using TrganTest
Attach tests to a container using TrganTest
:
TrganTest test = container.CreateTest(name: "Valid Login");
4. Update Test Status
Mark test outcomes using status methods:
test.Pass("pass message");
5. Generate the Report
Once all containers and tests are defined and updated, finalize the report:
report.Generate();
Continue to the next page to explore advanced features.