refactor(dotnet): add collection audit trail
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Successful in 23s
Validators (Pushes and Pull Requests) / validate-core (push) Has been cancelled

This commit is contained in:
2026-07-13 00:14:05 +09:00
parent ee4ae5583d
commit 6f252162ef
4 changed files with 61 additions and 11 deletions
@@ -93,6 +93,11 @@ public class KisDataCollectionOrchestratorTests
var runId = "test-run-002";
var ticker = "005930";
var account = "mock";
var auditPath = Path.Combine(FindRepoRoot(), "Temp", "collection_audit", $"{runId}.jsonl");
if (File.Exists(auditPath))
{
File.Delete(auditPath);
}
_repositoryMock
.Setup(r => r.GetLatestSnapshotsForTickerAsync(ticker, It.IsAny<int>()))
@@ -128,6 +133,8 @@ public class KisDataCollectionOrchestratorTests
Assert.NotNull(result);
Assert.Equal("COMPLETED", result.Status);
Assert.Equal(1, result.SuccessCount);
Assert.True(File.Exists(auditPath));
Assert.Contains("COMPLETED", File.ReadAllText(auditPath));
_kisApiClientMock.Verify(
k => k.GetCurrentPriceAsync(ticker, account),
@@ -390,4 +397,19 @@ public class KisDataCollectionOrchestratorTests
Assert.False(result);
Assert.Null(args[2]);
}
private static string FindRepoRoot()
{
var current = new DirectoryInfo(AppContext.BaseDirectory);
while (current != null)
{
if (Directory.Exists(Path.Combine(current.FullName, ".git")))
{
return current.FullName;
}
current = current.Parent;
}
throw new InvalidOperationException("Repository root not found.");
}
}