Added tests which guard the JSON of visual briefings and model answers before source generation

This commit is contained in:
Thorsten Sommer committed 2026-11-03 08:17:30 +01:00
1 parent 24e3c22db3
commit e54566f1f7
22 files changed
+1102 -12

No files matched your search

@@ -7,7 +7,7 @@ namespace AIStudio.Tools.PowerPoint;
internal sealed partial record SlideDeckSpec
{
private static readonly JsonSerializerOptions JSON_OPTIONS = new()
internal static readonly JsonSerializerOptions JSON_OPTIONS = new()
{
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
PropertyNameCaseInsensitive = true,
@@ -158,17 +158,18 @@ internal sealed partial record SlideDeckSpec
private static string Clean(string? text) => text?.Trim() ?? string.Empty;
//
// What the model writes, before anything is checked. Every value may be missing or null.
// What the model writes, before anything is checked. Every value may be missing or null. Internal
// rather than private, so that the JSON context of the deck can name them:
//
private sealed class DeckDto
internal sealed class DeckDto
{
public string? Title { get; set; }
public List<SlideDto?>? Slides { get; set; }
}
private sealed class SlideDto
internal sealed class SlideDto
{
public int? TemplateSlide { get; set; }
@@ -191,7 +192,7 @@ internal sealed partial record SlideDeckSpec
public JsonElement? Remove { get; set; }
}
private sealed class TableDto
internal sealed class TableDto
{
public List<JsonElement>? Headers { get; set; }