using System.IO; using System.Text.Json; using System.Windows; using System.Windows.Controls; using XFEToolBox.Core.Tools; using XFEToolBox.QuickTools; namespace QuickTools.Validation; internal static partial class Program { private static async Task ValidateManifestEntries() { foreach (string folder in Folders) await Test("Actual manifest entry / production content parent / " + folder, async () => { var manifest = JsonSerializer.Deserialize(File.ReadAllText(Path.Combine(WorkspaceRoot, folder, "manifest.json")), ReleaseJson)!; Ensure(manifest.Category != "快捷工具", "Invalid category"); var type = typeof(Program).Assembly.GetType(manifest.Entry.ViewClass, true)!; var entry = (FrameworkElement)Activator.CreateInstance(type)!; // Match the real runtime's ContentControl/Border parent. A Page here throws // during layout, even though direct component and compilation tests pass. var window = FixtureWindow(new Border { Child = new ContentControl { Content = entry } }); try { window.Show(); await Pump(window); Ensure(entry.ActualWidth > 0 && entry.ActualHeight > 0, "Entry failed to layout"); var page = Descendants(entry).OfType().Single(); Ensure(Descendants(page).OfType