refactor(dotnet): add scheduler audit trail
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Successful in 16s
Validators (Pushes and Pull Requests) / validate-core (push) Successful in 2m0s

This commit is contained in:
2026-07-13 00:11:52 +09:00
parent d7c106f292
commit ee4ae5583d
3 changed files with 88 additions and 1 deletions
@@ -87,6 +87,26 @@ public class SchedulerServiceTests
Assert.Contains(defs, d => d.JobId == "monthly-optimization" && d.IsRecurring);
}
[Fact]
public async Task FetchPriceAsync_WritesAuditTrail()
{
var root = FindRepoRoot();
var auditDir = Path.Combine(root, "Temp", "scheduler_audit");
if (Directory.Exists(auditDir))
{
Directory.Delete(auditDir, true);
}
var service = CreateService();
await service.FetchPriceAsync("005930");
var auditPath = Path.Combine(auditDir, "fetch-price.jsonl");
Assert.True(File.Exists(auditPath));
var lines = File.ReadAllLines(auditPath);
Assert.NotEmpty(lines);
Assert.Contains("\"State\":\"SUCCEEDED\"", lines[0]);
}
[Fact]
public void LoadTickersFromJson_WhenFileMissing_FallsBackToDefaultUniverse()
{