test phase 23 verification script

This commit is contained in:
voltsrage
2026-06-24 01:19:03 +08:00
parent 2e80700bf0
commit 032cd1d240
14 changed files with 240 additions and 86 deletions
@@ -116,6 +116,25 @@ public class TrendDetectorTests : IAsyncLifetime
(await redis.GetDatabase().KeyExistsAsync(key)).Should().BeFalse();
}
[Fact]
public async Task UnknownEncounter_SkipsAlert()
{
using var scope = _fixture.Services.CreateScope();
var detector = scope.ServiceProvider.GetRequiredService<TrendDetector>();
var unknownEncounterId = Guid.NewGuid();
await detector.ProcessObservationAsync(
unknownEncounterId, _patientId, "HEART_RATE", 72m, BaseTime);
var result = await detector.ProcessObservationAsync(
unknownEncounterId, _patientId, "HEART_RATE", 95m, BaseTime.AddMinutes(10));
result.Outcome.Should().Be(TrendOutcome.EncounterNotFound);
result.AlertCreated.Should().BeFalse();
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
(await db.ClinicalAlerts.CountAsync()).Should().Be(0);
}
[Fact]
public async Task DuplicateTrendAlert_Idempotent()
{