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 <noreply@anthropic.com>
This commit is contained in:
parent
24bdfe60bc
commit
acf6753d07
2 changed files with 4 additions and 5 deletions
|
|
@ -15,7 +15,6 @@ namespace Schaad.Accounting.Repositories
|
||||||
// Human readable: indented, and umlauts/quotes written as-is instead of \u escapes.
|
// Human readable: indented, and umlauts/quotes written as-is instead of \u escapes.
|
||||||
WriteIndented = true,
|
WriteIndented = true,
|
||||||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
|
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
|
||||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
|
||||||
PropertyNameCaseInsensitive = true,
|
PropertyNameCaseInsensitive = true,
|
||||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -92,10 +92,10 @@ public class XmlToJsonMigratorTestShould : IDisposable
|
||||||
await sut.MigrateAsync(dataPath);
|
await sut.MigrateAsync(dataPath);
|
||||||
|
|
||||||
var json = File.ReadAllText(Path.Combine(dataDir, "Transactions.json"));
|
var json = File.ReadAllText(Path.Combine(dataDir, "Transactions.json"));
|
||||||
json.ShouldContain("\"text\": \"Gebäudeversicherung\"");
|
json.ShouldContain("\"Text\": \"Gebäudeversicherung\"", Case.Sensitive);
|
||||||
json.ShouldContain("\n \"id\": \"t1\"");
|
json.ShouldContain("\n \"Id\": \"t1\"", Case.Sensitive);
|
||||||
json.ShouldNotContain("\"fxRate\": null");
|
json.ShouldNotContain("FxRate\": null", Case.Insensitive);
|
||||||
json.ShouldNotContain("readOnly");
|
json.ShouldNotContain("ReadOnly", Case.Insensitive);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue