Generated the JSON contracts of the stored data at compile time (#1148)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-02 18:23:19 +01:00
1 parent fc7399e81b
commit e954881fda
75 files changed
+5437 -298

No files matched your search

+2 -2
View File
@@ -10,7 +10,7 @@ public sealed class ContentPresentationTests
[Test]
public void TheDataHashCodeFollowsNewData()
{
var presentation = ContentPresentation.Create(ContentPresentationKind.SWOT_ANALYSIS, new { heading = "First" });
var presentation = ContentPresentation.Create(ContentPresentationKind.SWOT_ANALYSIS, new { heading = "First" }, JsonSerializerOptions.Default);
var firstHashCode = presentation.GetDataHashCode();
presentation.Data = JsonSerializer.SerializeToElement(new { heading = "Second" });
@@ -33,7 +33,7 @@ public sealed class ContentPresentationTests
[Test]
public void ACloneHasTheSameDataHashCode()
{
var presentation = ContentPresentation.Create(ContentPresentationKind.SWOT_ANALYSIS, new { heading = "First" });
var presentation = ContentPresentation.Create(ContentPresentationKind.SWOT_ANALYSIS, new { heading = "First" }, JsonSerializerOptions.Default);
Assert.That(presentation.DeepClone().GetDataHashCode(), Is.EqualTo(presentation.GetDataHashCode()));
}