Resolve all 46 low-severity architecture review findings

This commit is contained in:
Joseph Doherty
2026-09-09 22:56:36 -04:00
parent fef3e7675f
commit 9ee402bbcd
139 changed files with 2621 additions and 1082 deletions
@@ -19,6 +19,21 @@ public class SharedScriptServiceTests
_service = new SharedScriptService(_repoMock.Object, _auditMock.Object);
}
[Theory]
[InlineData("return System.IO.File.ReadAllText(\"x\");")]
[InlineData("return noSuchVariable;")]
public async Task CreateAndUpdate_RejectInvalidCodeBeforeSaving(string code)
{
var existing = new SharedScript("Existing", "return 1;");
_repoMock.Setup(r => r.GetSharedScriptByIdAsync(1, It.IsAny<CancellationToken>())).ReturnsAsync(existing);
var create = await _service.CreateSharedScriptAsync("New", code, null, null, "admin");
var update = await _service.UpdateSharedScriptAsync(1, code, null, null, "admin");
Assert.True(create.IsFailure);
Assert.True(update.IsFailure);
Assert.Equal("return 1;", existing.Code);
_repoMock.Verify(r => r.SaveChangesAsync(It.IsAny<CancellationToken>()), Times.Never);
}
[Fact]
public async Task CreateSharedScript_Success()
{