fix(scriptanalysis): M3.6 — full-framework analysis refs close forbidden-type-in-allowed-ns blind spot; pin Process/Stopwatch; fix stale codec test; drop dead ContainsInCode
This commit is contained in:
@@ -147,6 +147,23 @@ public class ScriptTrustValidatorTests
|
||||
Assert.NotEmpty(ScriptTrustValidator.FindViolations(code));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Rejects_Process_QualifiedType()
|
||||
{
|
||||
var code = "var p = System.Diagnostics.Process.Start(\"x\");";
|
||||
Assert.NotEmpty(ScriptTrustValidator.FindViolations(code));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Rejects_Process_BareIdentifier_ViaUsing()
|
||||
{
|
||||
// System.Diagnostics is an ALLOWED namespace (Stopwatch/Debug ok), so the
|
||||
// using directive is not flagged; Process is a forbidden TYPE reached as a
|
||||
// bare identifier. This pins whether FindViolations resolves it.
|
||||
var code = "using System.Diagnostics; var p = Process.Start(\"x\");";
|
||||
Assert.NotEmpty(ScriptTrustValidator.FindViolations(code));
|
||||
}
|
||||
|
||||
// ---- Clean (empty violations) -------------------------------------------
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user