mehdihadeli/tdd-sample
46.2
Weak · 21 September 2026
1.4k
lines of production code
C#
primary language
4
measurements over time
What this system is
This system is a .NET 8 API scaffolded for Test-Driven Development using Vertical Slice Architecture and Minimal APIs. It provides foundational infrastructure for versioned endpoints, structured error handling, and data persistence via Entity Framework Core with PostgreSQL. The application currently implements core features for managing Todo items and retrieving paginated user lists from an external service.
Features
Add endpoints for creating and updating todo items
This change introduces the ability to create and update todo items via new API endpoints. The create feature exposes a POST endpoint that accepts a title, completion status, and user ID, returning the new item's ID or a validation error. The update feature exposes a PUT endpoint that modifies an existing item by ID, handling cases where the item is not found or the request is invalid.
src/TDDSample/TodoItem/Features/CreatingTodoItem · high confidence
Add users HTTP client and DTOs for paginated user retrieval
New data-transfer objects (AddressClientDto, UserClientDto, UsersListPageClientDto) and a UsersHttpClient implementation have been added to the shared clients layer. The client fetches paginated user lists from a configurable endpoint, maps the response to domain User models via AutoMapper, and returns a PagedList, enabling UI components to retrieve and display users with pagination support.
src/TDDSample/Shared/Clients · high confidence
Added .NET 8 dev container and code formatting hooks
Developers can now use a pre-configured VS Code dev container environment based on .NET 8, which includes the MesloLGM Nerd Font, GitHub CLI, and specific VS Code extensions for C\# and formatting. Additionally, Husky hooks are installed to automatically format C\# code using CSharpier on every commit and enforce commit message linting.
.devcontainer, .husky · high confidence
Initial TodoItem feature with update capability and API versioning
This change introduces the TodoItem module, providing a complete set of endpoints for managing todo items (create, read by ID, list, and update) under the versioned route api/v1/todo-items. It includes the necessary data models (TodoItem, TodoItemAudit), DTOs (TodoItemDto, PageRequest, PagedList), and an AutoMapper profile to handle mapping between the UpdateTodoItem command and the domain model. The feature is wired into the application's service collection and endpoint routing via the new Config classes in both the Shared and TodoItem namespaces.
src/TDDSample/TodoItem · high confidence
Initial data access layer with Entity Framework Core and PostgreSQL
This change introduces the foundational data access components for the application, establishing a repository pattern built on Ardalis.Specification and Entity Framework Core. It includes the TodoDbContext configured to use PostgreSQL via Npgsql, entity configuration for TodoItems, and repository interfaces (IRepository, IReadRepository) with a concrete EfRepository implementation that supports paginated queries. Additionally, a design-time context factory is provided for migrations, and the database is seeded with 20 initial todo items upon creation.
src/TDDSample/Shared/Data · high confidence
Initial implementation of Todo and User management features
This change introduces the initial set of API endpoints and backend logic for managing Todo items and Users. For Todo items, it adds handlers and endpoints to retrieve a single item by ID or list items with pagination, utilizing MediatR and AutoMapper for request handling and data mapping. For Users, it implements a paginated list endpoint that fetches data via an HTTP client, maps it to DTOs, and exposes it through a versioned API group (v1). The implementation includes necessary models, DTOs, and mapping profiles for both domains, establishing the foundational structure for these features.
src/TDDSample/TodoItem/Features/GettingTodoItemById, src/TDDSample/TodoItem/Features/GettingTodoItems, src/TDDSample/Users · high confidence
Initial project scaffolding with .NET 8 and TDD structure
The repository has been initialized with a .NET 8 project structure, specifying SDK version 8.0.303 in global.json. It includes configuration for code formatting and analysis via .editorconfig, .csharpierrc.yaml, and stylecop.json, alongside a commitlint configuration for conventional commits. The project is set up as a sample for Test-Driven Development (TDD) using Vertical Slice Architecture and Minimal APIs, with an MIT license and a README explaining the development workflow and prerequisites.
(repo-wide) · high confidence
Introduction of structured custom exception hierarchy
The application now includes a dedicated exception handling layer in the shared module, featuring a base CustomException that carries HTTP status codes and error messages. This is supplemented by specific subclasses (AppException, BadRequestException, ConflictException, DomainException, InternalServerException, NotFoundException, ValidationException, and HttpResponseException) that map to standard HTTP status codes, enabling more precise error reporting to API consumers.
src/TDDSample/Shared/Exceptions · high confidence
New shared infrastructure and HTTP client extensions
This change introduces a set of new extension methods in the shared project to streamline application setup and HTTP handling. It adds an \AddInfrastructure\ method that configures Entity Framework Core with an in-memory database, registers AutoMapper and MediatR, and wires up the repository pattern. It also includes \AddUsersHttpClient\ to configure typed HTTP clients with options-based base addresses and timeouts, and a custom \EnsureSuccessStatusCodeWithDetailAsync\ extension that throws detailed exceptions on HTTP errors instead of generic ones. Additionally, it adds \AddAppProblemDetails\ to customize ASP.NET Core problem details, specifically handling exception features for .NET 8 preview 5 compatibility.
src/TDDSample/Shared/Extensions · high confidence
Behavioural changes
API versioning, structured error handling, and external service integration
The API now supports explicit versioning via the 'api-version' header, query string, or URL segment, with version 1.0 as the default and sunset policies for older versions. Error handling has been restructured to use a centralized problem-details approach, ensuring consistent error responses in production while retaining developer exception pages in development. Additionally, the application is configured to connect to a PostgreSQL database and includes an HTTP client for integrating with the DummyJSON external service.
src/TDDSample.Api · high confidence
Structured exception handling with typed ProblemDetails responses
The application now uses a centralized ProblemDetails system to convert exceptions into standardized HTTP error responses. A new middleware captures unhandled exceptions, which are then mapped to specific HTTP status codes (such as 400, 401, 404, and 500) via the \IProblemDetailMapper\ interface and its \DefaultProblemDetailMapper\ implementation. The \ProblemDetailsService\ orchestrates this process, ensuring that errors are returned with consistent JSON formatting (\application/problem+json\) and metadata. Additionally, specific result types (\InternalHttpProblemResult\, \NotFoundHttpProblemResult\, \UnAuthorizedHttpProblemResult\) are provided to allow endpoints to return typed ProblemDetails directly.
src/TDDSample/Shared/ProblemDetail · high confidence
Test coverage
Added integration tests for creating and retrieving todo items; Added unit tests for TodoItems features; Added unit tests for UsersHttpClient and mapping configuration; Added unit tests for the GetTodoItemById feature; Added unit tests for the GetUsers endpoint and handler; Added unit tests for the Todo Item Update feature; Removed empty default unit test.
Dependencies
Upgrade to .NET 8 and centralize package management
The application has been upgraded from .NET 7 to .NET 8, updating the target framework for the API, core, and test projects. To simplify dependency maintenance, package versions are now centrally managed via a root Directory.Packages.props file, replacing the previous scattered configuration. The test project has also been enhanced with coverage collection using Coverlet and ReportGenerator, and the frontend tooling now includes Husky for commit linting.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 75 → 46 (-29.2)
- Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 88 → 63 (-24.2)
- Architecture 91 → 91 (+0.0)
- Maturity 93 → 93 (+0.0)
- Readiness 69 → 53 (-15.3)
- Security 73 → 25 (-47.9)
Resolved (10)
- High IaC: DS-0002 (.devcontainer/Dockerfile)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Medium IaC: DS-0001 (.devcontainer/Dockerfile)
- No exposed public API
- Outdated: Microsoft.VisualStudio.TestPlatform
- early-stage repository — too little history to judge knowledge freshness
- redundant comment (src/TDDSample.Api/Program.cs)
- single-maintainer — knowledge-concentration (bus factor) risk
New (75)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- AnalyzerSeverityNone (.editorconfig)
- …and 55 more
Architecture
- Unchanged — 2 containers · 0 contexts · 0 edges
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
mehdihadeli/tdd-sample was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 512bf78a1a44afb00aa6bebd64662e096f41e2f6 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.