Implement deferred WaitQueue, DiskAvailability, and NoOpCache behavior with tests

This commit is contained in:
Joseph Doherty
2026-02-27 09:58:37 -05:00
parent 8849265780
commit a660e38575
11 changed files with 508 additions and 25 deletions

View File

@@ -31,13 +31,30 @@ public sealed class OcspResponseCacheTests
}
[Fact]
public void NoOpCache_AndMonitor_ShouldNoOpSafely()
public void NoOpCache_LifecycleAndStats_ShouldNoOpSafely()
{
var noOp = new NoOpCache();
noOp.Online().ShouldBeFalse();
noOp.Type().ShouldBe("none");
noOp.Config().ShouldNotBeNull();
noOp.Stats().ShouldBeNull();
noOp.Start();
noOp.Online().ShouldBeTrue();
noOp.Stats().ShouldNotBeNull();
noOp.Put("k", [5]);
noOp.Get("k").ShouldBeNull();
noOp.Remove("k");
noOp.Remove("k"); // alias to Delete
noOp.Delete("k");
noOp.Stop();
noOp.Online().ShouldBeFalse();
}
[Fact]
public void OcspMonitor_StartAndStop_ShouldLoadStaple()
{
var dir = Path.Combine(Path.GetTempPath(), $"ocsp-monitor-{Guid.NewGuid():N}");
Directory.CreateDirectory(dir);
try