Table of Contents

Class ApplicationAuditIntegrityHealthCheckTests

Namespace
ProjectTemplate.Web.Tests
Assembly
ProjectTemplate.Web.Tests.dll

Provides tests for the audit integrity health check, including reconciliation freshness and endpoint placement.

public sealed class ApplicationAuditIntegrityHealthCheckTests
Inheritance
ApplicationAuditIntegrityHealthCheckTests
Inherited Members

Methods

AddApplicationAuditReconciliationCore_ThresholdNotGreaterThanInterval_FailsValidation()

Verifies that startup validation rejects a stale-run threshold that is not greater than the interval.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/ApplicationAuditIntegrityHealthCheckTests.cs", 163)]
public void AddApplicationAuditReconciliationCore_ThresholdNotGreaterThanInterval_FailsValidation()

AddApplicationAuditReconciliation_RegistersCheckOutsideReadiness()

Verifies that the audit integrity check is excluded from readiness and selected by the audit endpoint tag.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/ApplicationAuditIntegrityHealthCheckTests.cs", 141)]
public void AddApplicationAuditReconciliation_RegistersCheckOutsideReadiness()

CheckHealthAsync_ConfiguredThreshold_IsHonored()

Verifies that a configured stale-run threshold replaces the default.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/ApplicationAuditIntegrityHealthCheckTests.cs", 66)]
public Task CheckHealthAsync_ConfiguredThreshold_IsHonored()

Returns

Task

A task that represents the asynchronous test operation.

CheckHealthAsync_CriticalFindingAndStaleRun_ReportsUnhealthy()

Verifies that a critical finding still reports Unhealthy when reconciliation is also stale.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/ApplicationAuditIntegrityHealthCheckTests.cs", 99)]
public Task CheckHealthAsync_CriticalFindingAndStaleRun_ReportsUnhealthy()

Returns

Task

A task that represents the asynchronous test operation.

CheckHealthAsync_NoCompletedRun_ReportsDegraded()

Verifies that a process whose worker never completed a run reports Degraded instead of Healthy.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/ApplicationAuditIntegrityHealthCheckTests.cs", 21)]
public Task CheckHealthAsync_NoCompletedRun_ReportsDegraded()

Returns

Task

A task that represents the asynchronous test operation.

CheckHealthAsync_RecentRun_ReportsHealthy()

Verifies that a recent successful run with no findings reports Healthy.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/ApplicationAuditIntegrityHealthCheckTests.cs", 35)]
public Task CheckHealthAsync_RecentRun_ReportsHealthy()

Returns

Task

A task that represents the asynchronous test operation.

CheckHealthAsync_ReconciliationDisabled_ReportsHealthy()

Verifies that disabled reconciliation reports Healthy without evaluating freshness.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/ApplicationAuditIntegrityHealthCheckTests.cs", 113)]
public Task CheckHealthAsync_ReconciliationDisabled_ReportsHealthy()

Returns

Task

A task that represents the asynchronous test operation.

CheckHealthAsync_RunOlderThanDefaultThreshold_ReportsDegraded()

Verifies that a run older than the default threshold of three intervals reports Degraded.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/ApplicationAuditIntegrityHealthCheckTests.cs", 50)]
public Task CheckHealthAsync_RunOlderThanDefaultThreshold_ReportsDegraded()

Returns

Task

A task that represents the asynchronous test operation.

CheckHealthAsync_WorkerNotRunInProcess_DoesNotEvaluateFreshness()

Verifies that freshness is not evaluated when another process runs the reconciliation loop.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/ApplicationAuditIntegrityHealthCheckTests.cs", 83)]
public Task CheckHealthAsync_WorkerNotRunInProcess_DoesNotEvaluateFreshness()

Returns

Task

A task that represents the asynchronous test operation.

GetStaleRunThreshold_NotConfigured_UsesThreeIntervals()

Verifies that the default stale-run threshold is three reconciliation intervals.

[Fact("/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/tests/ProjectTemplate.Web.Tests/ApplicationAuditIntegrityHealthCheckTests.cs", 127)]
public void GetStaleRunThreshold_NotConfigured_UsesThreeIntervals()