using Avalonia.Controls; using Avalonia.Headless.XUnit; using Avalonia.VisualTree; using JdeScoping.ConfigManager.Views; namespace JdeScoping.ConfigManager.Tests.Views; /// /// UI tests for . /// public class MainWindowTests { /// /// Verifies that the main window displays with the correct title. /// [AvaloniaFact] public void MainWindow_ShowsWithCorrectTitle() { // Arrange & Act var window = new MainWindow(); window.Show(); // Assert window.Title.ShouldBe("JdeScoping ConfigManager"); } /// /// Verifies that the main window contains a TreeView for navigation. /// [AvaloniaFact] public void MainWindow_ContainsTreeView() { // Arrange & Act var window = new MainWindow(); window.Show(); // Assert var treeView = window.FindDescendantOfType(); treeView.ShouldNotBeNull(); } /// /// Verifies that the main window contains a menu bar. /// [AvaloniaFact] public void MainWindow_ContainsMenuBar() { // Arrange & Act var window = new MainWindow(); window.Show(); // Assert var menu = window.FindDescendantOfType(); menu.ShouldNotBeNull(); } /// /// Verifies that the main window has the expected minimum size constraints. /// [AvaloniaFact] public void MainWindow_HasExpectedMinimumSize() { // Arrange & Act var window = new MainWindow(); window.Show(); // Assert - MinWidth=900, MinHeight=600 as defined in AXAML window.MinWidth.ShouldBe(900); window.MinHeight.ShouldBe(600); } /// /// Verifies that the main window has the expected default size. /// [AvaloniaFact] public void MainWindow_HasExpectedDefaultSize() { // Arrange & Act var window = new MainWindow(); window.Show(); // Assert - Width=1200, Height=800 as defined in AXAML window.Width.ShouldBe(1200); window.Height.ShouldBe(800); } /// /// Verifies that the main window contains toolbar buttons. /// [AvaloniaFact] public void MainWindow_ContainsToolbarButtons() { // Arrange & Act var window = new MainWindow(); window.Show(); // Assert var buttons = window.GetVisualDescendants().OfType