From acf6753d077f9dca2d25ee1c9e275e6af837dab7 Mon Sep 17 00:00:00 2001 From: Claudio Schaad Date: Thu, 22 Oct 2026 13:44:24 +0200 Subject: [PATCH] Use PascalCase property names in JSON data files Property names now match the C# models (BankTransactionText instead of bankTransactionText). Reading stays case-insensitive. The migrator test now checks casing case-sensitively; Shouldly's ShouldContain ignores case by default, so it never actually checked it. Co-Authored-By: Claude Opus 5.5 --- Schaad.Accounting.Db/JsonStorage.cs | 1 - Schaad.Accounting.Tests/XmlToJsonMigratorTestShould.cs | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Schaad.Accounting.Db/JsonStorage.cs b/Schaad.Accounting.Db/JsonStorage.cs index 1a265f4..50b518e 100644 --- a/Schaad.Accounting.Db/JsonStorage.cs +++ b/Schaad.Accounting.Db/JsonStorage.cs @@ -15,7 +15,6 @@ namespace Schaad.Accounting.Repositories // Human readable: indented, and umlauts/quotes written as-is instead of \u escapes. WriteIndented = true, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, - PropertyNamingPolicy = JsonNamingPolicy.CamelCase, PropertyNameCaseInsensitive = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }; diff --git a/Schaad.Accounting.Tests/XmlToJsonMigratorTestShould.cs b/Schaad.Accounting.Tests/XmlToJsonMigratorTestShould.cs index c2c41ea..e910795 100644 --- a/Schaad.Accounting.Tests/XmlToJsonMigratorTestShould.cs +++ b/Schaad.Accounting.Tests/XmlToJsonMigratorTestShould.cs @@ -92,10 +92,10 @@ public class XmlToJsonMigratorTestShould : IDisposable await sut.MigrateAsync(dataPath); var json = File.ReadAllText(Path.Combine(dataDir, "Transactions.json")); - json.ShouldContain("\"text\": \"Gebäudeversicherung\""); - json.ShouldContain("\n \"id\": \"t1\""); - json.ShouldNotContain("\"fxRate\": null"); - json.ShouldNotContain("readOnly"); + json.ShouldContain("\"Text\": \"Gebäudeversicherung\"", Case.Sensitive); + json.ShouldContain("\n \"Id\": \"t1\"", Case.Sensitive); + json.ShouldNotContain("FxRate\": null", Case.Insensitive); + json.ShouldNotContain("ReadOnly", Case.Insensitive); } [Fact]