Ejemplo n.º 1
0
        private static void EnsureNotepadHasExpectedMenus(AutomationElement windowElement)
        {
            var menuBar = windowElement.FindFirstDescendantById("MenuBar");

            menuBar.ExecuteWithUpdatedCache(
                AutomationExtensions.BuildCacheRequest(TreeScope.Element | TreeScope.Children, AutomationElement.NameProperty),
                m => CollectionAssert.AreEqual(NotepadMenuNames, GetChildNames(m)));
        }
Ejemplo n.º 2
0
    public static void Run(Arguments arguments)
    {
        if (arguments.ShowHelp)
        {
            Usage();
            return;
        }

        AutomationElement.FromHandle(arguments.WindowHandle).ExecuteWithUpdatedCache(AutomationExtensions.BuildCacheRequest(TreeScope.Element | TreeScope.Descendants, AutomationElement.NameProperty),
                                                                                     element => DumpValuesRecursive(element, 0));
    }
Ejemplo n.º 3
0
        private static void EnsureNotepadHasExpectedMenusWithHierarchicalValueProvider(AutomationElement windowElement)
        {
            var hvp     = new HierarchicalValueProvider <AutomationElement, string, string>(windowElement);
            var menuBar = windowElement.FindFirstDescendantById("MenuBar");

            menuBar.ExecuteWithUpdatedCache(
                AutomationExtensions.BuildCacheRequest(TreeScope.Element | TreeScope.Children, AutomationElement.NameProperty),
                m =>
            {
                var values = hvp.GetValues(BuildNotepadMenuTree());
                CollectionAssert.AreEqual(NotepadMenuNames, values["menu"]);
            });
        }