test(installer): add InstallManifest wrong-shape json test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mika Kuns
2026-04-15 08:59:51 +02:00
parent 921e626208
commit 2fc6924dcb

View File

@@ -63,4 +63,14 @@ public sealed class InstallManifestStoreTests : IDisposable
var result = InstallManifestStore.TryRead(_tempDir); var result = InstallManifestStore.TryRead(_tempDir);
Assert.Null(result); Assert.Null(result);
} }
[Fact]
public void TryRead_ReturnsNull_WhenJsonIsValidButShapeIsWrong()
{
// Valid JSON, but installedAt has a wrong type — causes JsonException, swallowed silently.
File.WriteAllText(Path.Combine(_tempDir, "install.json"),
"""{"version":"1.0","installDir":"x","workerDir":"y","installedAt":12345}""");
var result = InstallManifestStore.TryRead(_tempDir);
Assert.Null(result);
}
} }