@@ -170,17 +170,20 @@ public sealed class FocasWriteMacroTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Per_kind_gate_does_not_affect_PMC_writes()
|
||||
public async Task Per_kind_gate_does_not_cross_contaminate_PMC_writes()
|
||||
{
|
||||
// Defense in depth: AllowParameter / AllowMacro stay locked but PMC writes
|
||||
// (which already worked in F4-a) keep flowing through Writes.Enabled +
|
||||
// per-tag Writable. This guards against regressing the F4-a surface.
|
||||
// (gated by F4-c's AllowPmc) keep flowing when the operator opted in to PMC
|
||||
// alone. Pre-F4-c this test asserted PMC needed no per-kind gate; post-F4-c
|
||||
// it asserts AllowPmc is the gate that matters for PMC, independent of the
|
||||
// PARAM/MACRO gates.
|
||||
var drv = NewDriver(
|
||||
writes: new FocasWritesOptions
|
||||
{
|
||||
Enabled = true,
|
||||
AllowParameter = false,
|
||||
AllowMacro = false,
|
||||
AllowPmc = true,
|
||||
},
|
||||
tags:
|
||||
[
|
||||
@@ -193,8 +196,8 @@ public sealed class FocasWriteMacroTests
|
||||
[new WriteRequest("R100", (sbyte)1)], CancellationToken.None);
|
||||
|
||||
results.Single().StatusCode.ShouldBe(FocasStatusMapper.Good);
|
||||
// PMC routes through the generic WriteAsync, not the typed entry points.
|
||||
factory.Clients[0].WriteLog.Count.ShouldBe(1);
|
||||
// PMC routes through the typed WritePmcRangeAsync entry point post-F4-c.
|
||||
factory.Clients[0].PmcRangeWriteLog.Count.ShouldBe(1);
|
||||
factory.Clients[0].ParameterWriteLog.ShouldBeEmpty();
|
||||
factory.Clients[0].MacroWriteLog.ShouldBeEmpty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user