Skip to content

Commit 5269c90

Browse files
committed
Refactor template serialization to use TemplateRegistry
Replaced the serialization of the `templates` object with a `TemplateRegistry` object initialized with `templates`. This change alters the data structure before serialization to JSON, potentially impacting how data is stored in the `templateRegistryPath` file.
1 parent d5b2496 commit 5269c90

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/Blake.IntegrationTests/Commands/BlakeNewCommandTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public async Task BlakeNew_WithListOption_ShowsAvailableTemplates()
4444
new (Guid.Empty, shortName2, longName2, "", "", "", DateTime.MinValue, "")
4545
};
4646

47-
var jsonContent = System.Text.Json.JsonSerializer.Serialize(templates, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });
47+
var registry = new TemplateRegistry(templates);
48+
49+
var jsonContent = System.Text.Json.JsonSerializer.Serialize(registry, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });
4850
Directory.CreateDirectory(Path.GetDirectoryName(templateRegistryPath)!);
4951
File.WriteAllText(templateRegistryPath, jsonContent);
5052
}

0 commit comments

Comments
 (0)