Fecha de Generación: 29 de Diciembre de 2025
Herramienta: Coverlet + ReportGenerator
Framework de Tests: xUnit 2.9.3
| Métrica | Valor | Porcentaje |
|---|---|---|
| Line Coverage | 156 / 572 | 27.2% |
| Branch Coverage | 11 / 30 | 36.6% |
| Method Coverage | 31 / 93 | 33.3% |
| Fully Covered Methods | 29 / 93 | 31.1% |
- Coverable lines: 572
- Covered lines: 156
- Total lines: 1,277
| Componente | Cobertura |
|---|---|
| ? CreatePaymentCommand | 100% |
| ? CreatePaymentCommandHandler | 100% |
| ? CreatePaymentCommandValidator | 100% |
| ? CreatePaymentResult | 100% |
| ? Payment (Entity) | 100% |
| ? GetPaymentByIdQuery | 0% |
| ? GetPaymentByIdQueryHandler | 0% |
| ? UpdatePaymentStatusCommand | 0% |
| ? UpdatePaymentStatusCommandHandler | 0% |
| ? PaymentEntityConfiguration | 0% |
| ? PaymentsModule | 0% |
| ? CreatePaymentRequest (DTO) | 0% |
| ? PaymentResponse (DTO) | 0% |
| ? PaymentStatusResponse (DTO) | 0% |
| ? PaymentsController | 0% |
Componentes Testeados: 5 / 15
Componentes Críticos Cubiertos: ? Create Payment Flow
| Componente | Cobertura |
|---|---|
| ? RiskEvaluationResult | 100% |
| ? RiskEvaluationService | 95.3% |
| ? EvaluateRiskCommand | 0% |
| ? EvaluateRiskCommandHandler | 0% |
| ? EvaluateRiskResult | 0% |
| ? DailyPaymentSummary (Entity) | 0% |
| ? DailyPaymentSummaryEntityConfiguration | 0% |
| ? RiskEvaluationModule | 0% |
Componentes Testeados: 2 / 8
Componentes Críticos Cubiertos: ? Business Rules (RiskEvaluationService)
| Componente | Cobertura |
|---|---|
| ? BaseAuditableEntity | 100% |
| ? Result | 88.8% |
| ? Result | 75% |
| ? DomainException | 0% |
| ? NotFoundException | 0% |
| ? ValidationException | 0% |
Componentes Testeados: 3 / 6
Componentes Críticos Cubiertos: ? Result Pattern
-
CreatePaymentCommandValidatorTests - 8 tests
- Cobertura: 100% del validador
- Todas las reglas de validación cubiertas
-
CreatePaymentCommandHandlerTests - 3 tests
- Cobertura: 100% del handler
- Casos: éxito, error, timestamps
- RiskEvaluationServiceTests - 25 tests
- Cobertura: 95.3% del servicio
- Reglas de negocio completamente cubiertas
- Edge cases incluidos
- ?
CreatePaymentCommand- Command object - ?
CreatePaymentCommandHandler- Command handler - ?
CreatePaymentCommandValidator- FluentValidation - ?
CreatePaymentResult- Result DTO - ?
Payment- Domain entity
- ?
RiskEvaluationResult- Result object - ?
RiskEvaluationService- 95.3% (casi 100%)
- ?
BaseAuditableEntity- Base entity - ?
Result<T>- 88.8% - ?
Result- 75%
GetPaymentByIdQueryHandler- Query handlerUpdatePaymentStatusCommandHandler- Command handlerPaymentsController- API ControllerPaymentEntityConfiguration- EF ConfigurationPaymentsModule- Module initializer- DTOs (Request/Response)
EvaluateRiskCommandHandler- Command handlerDailyPaymentSummary- Domain entityDailyPaymentSummaryEntityConfiguration- EF ConfigurationRiskEvaluationModule- Module initializerEvaluateRiskCommand- Command object
DomainException- Custom exceptionNotFoundException- Custom exceptionValidationException- Custom exception
Line Coverage: ???????????????????????????????? 27.2%
Branch Coverage: ???????????????????????????????? 36.6%
Method Coverage: ???????????????????????????????? 33.3%
- ?? PaymentsController - API endpoints
- ?? GetPaymentByIdQueryHandler - Query principal
- ?? EvaluateRiskCommandHandler - Flujo de evaluación
- ?? UpdatePaymentStatusCommandHandler - Update de estado
- ?? PaymentsModule - Inicialización
- ?? RiskEvaluationModule - Inicialización
- ?? PaymentEntityConfiguration - EF Config
- ?? DailyPaymentSummaryEntityConfiguration - EF Config
- ?? DTOs (Request/Response) - Data Transfer Objects
- ?? Custom Exceptions - Exception handling
- ?? DailyPaymentSummary - Entity tests
// PaymentsControllerTests.cs
[Fact]
public async Task CreatePayment_WithValidRequest_ShouldReturn201Created()
{
// Arrange
var request = new CreatePaymentRequest { ... };
// Act
var result = await _controller.CreatePayment(request);
// Assert
result.Should().BeOfType<CreatedAtActionResult>();
}Impacto en cobertura: +15%
// GetPaymentByIdQueryHandlerTests.cs
[Fact]
public async Task HandleAsync_WhenPaymentExists_ShouldReturnPayment()
{
// Test implementation
}Impacto en cobertura: +10%
// EvaluateRiskCommandHandlerTests.cs
[Fact]
public async Task HandleAsync_WhenAmountExceeds2000_ShouldPublishDeniedResponse()
{
// Test implementation
}Impacto en cobertura: +12%
// ValidationExceptionTests.cs
[Fact]
public void Constructor_WithErrors_ShouldSetErrorsProperty()
{
// Test implementation
}Impacto en cobertura: +5%
- Tests de PaymentsController
- Tests de GetPaymentByIdQueryHandler
- Tests de UpdatePaymentStatusCommandHandler
- Tests de EvaluateRiskCommandHandler
Target Coverage: 50%
- Tests de integración de módulos
- Tests de EF Configurations
- Tests de Module Initializers
Target Coverage: 65%
- Tests de DTOs
- Tests de Excepciones Custom
- Tests E2E con TestServer
Target Coverage: 80%+
# Ejecutar tests con cobertura
dotnet test --collect:"XPlat Code Coverage"
# Generar reporte HTML
reportgenerator "-reports:tests\**\coverage.cobertura.xml" "-targetdir:coverage-report" "-reporttypes:Html;TextSummary"
# Abrir reporte
start coverage-report\index.html# GitHub Actions
- name: Test with Coverage
run: dotnet test --collect:"XPlat Code Coverage"
- name: Generate Report
run: reportgenerator "-reports:**/coverage.cobertura.xml" "-targetdir:coverage-report"
- name: Upload Coverage
uses: codecov/codecov-action@v3| Estándar | Target | Actual | Estado |
|---|---|---|---|
| Mínimo Aceptable | 60% | 27.2% | ? Por debajo |
| Recomendado | 80% | 27.2% | ? Por debajo |
| Excelente | 90%+ | 27.2% | ? Por debajo |
27.2% es bajo PERO:
? Componentes Críticos Cubiertos:
- Business Rules (RiskEvaluationService): 95.3%
- Validaciones (CreatePaymentValidator): 100%
- Command Handlers principales: 100%
? Componentes sin Tests:
- Controllers (0%) - No críticos para lógica de negocio
- DTOs (0%) - Simple data transfer
- Module Initializers (0%) - Infrastructure setup
- EF Configurations (0%) - Framework code
Conclusión: La cobertura de lógica de negocio crítica es del 95%+, aunque la cobertura general sea del 27%.
| Tipo de Código | Target | Actual | Prioridad |
|---|---|---|---|
| Business Rules | 95%+ | 95.3% | ? Alcanzado |
| Validations | 100% | 100% | ? Alcanzado |
| Handlers | 80% | 40% | ?? Mejorar |
| Controllers | 70% | 0% | ? Agregar |
| DTOs | 50% | 0% | ?? Opcional |
| Infrastructure | 30% | 0% | ?? Low Priority |
- Business Rules cubiertos al 95%+ ??
- Validaciones 100% testeadas ?
- 36 tests todos pasando ??
- Casos límite incluidos ??
- Theory tests para data-driven ??
- Controllers sin coverage (0%)
- Query handlers incompletos
- Integration tests faltantes
- Module initializers no testeados
- Corto Plazo: Agregar tests de controllers (+15%)
- Mediano Plazo: Completar handlers (+20%)
- Largo Plazo: Integration tests (+15%)
Target Final: 80% coverage en 3 semanas
- HTML Report:
coverage-report/index.html? Abrir en navegador - Summary:
coverage-report/Summary.txt - Cobertura XML:
tests/**/coverage.cobertura.xml
Generado por: Coverlet v6.0.4 + ReportGenerator v5.5.1
Fecha: 2025-12-29
Total Tests: 36 tests (100% passed)
Duración: 3.7 segundos