SearchTestControl.xaml の相互作用ロジック
Inheritance: System.Windows.Controls.UserControl
Exemple #1
0
        static void TestVisualTreeInTargetExtensions(SearchTestControl ctrl, Button button1, ListView listView)
        {
            var b = ctrl.VisualTree().ByBinding("Button1Command").Single();

            Assert.AreEqual(button1, b);
            Assert.AreEqual(3, listView.VisualTree().ByType <ListViewItem>().Count());
        }
Exemple #2
0
        static SearchTestControl Init(Grid grid)
        {
            SearchTestControl ctrl = new SearchTestControl();

            grid.Children.Add(ctrl);
            return(ctrl);
        }
Exemple #3
0
        static void TestLogicalTreeInTarget(SearchTestControl ctrl, Button button1, ListView listView)
        {
            var b = SearcherInTarget.ByBinding(TreeUtilityInTarget.LogicalTree(ctrl), "Button1Command").Single();

            Assert.AreEqual(button1, b);
            Assert.AreEqual(0, TreeUtilityInTarget.LogicalTree(listView).ByType <ListViewItem>().Count());
        }
Exemple #4
0
        static void TestBindingInTarget(SearchTestControl ctrl, Button button1, TextBox textBox)
        {
            DependencyObject b = SearcherInTarget.ByBinding(TreeUtilityInTarget.LogicalTree(ctrl), "Button1Command").Single();

            Assert.AreEqual(button1, b);

            var collection = SearcherInTarget.ByBinding(TreeUtilityInTarget.LogicalTree(ctrl), "DataText");

            Assert.AreEqual(2, collection.Count());

            var t = SearcherInTarget.ByBinding(TreeUtilityInTarget.LogicalTree(ctrl), "DataText", ctrl.DataContext).Single();

            Assert.AreEqual(textBox, t);
        }
Exemple #5
0
        static void TestBindingExtensionsInTarget(SearchTestControl ctrl, Button button1, TextBox textBox)
        {
            DependencyObject b = ctrl.LogicalTree().ByBinding("Button1Command").Single();

            Assert.AreEqual(button1, b);

            var collection = ctrl.LogicalTree().ByBinding("DataText");

            Assert.AreEqual(2, collection.Count());

            var t = ctrl.LogicalTree().ByBinding("DataText", ctrl.DataContext).Single();

            Assert.AreEqual(textBox, t);
        }
Exemple #6
0
        static void TestTypeExtensionsInTarget(SearchTestControl ctrl, ListView listView)
        {
            var collection = ctrl.LogicalTree().ByType(typeof(Button).FullName);

            Assert.AreEqual(2, collection.Count());
            collection = ctrl.LogicalTree().ByType <Button>();
            Assert.AreEqual(2, collection.Count());
            collection = ctrl.LogicalTree().ByType <ButtonBase>();
            Assert.AreEqual(3, collection.Count());
            var list = ctrl.LogicalTree().ByType(typeof(ListView).FullName).Single();

            Assert.AreEqual(list, listView);
            list = ctrl.LogicalTree().ByType <ListView>().Single();
            Assert.AreEqual(list, listView);
        }
Exemple #7
0
        static void TestTypeInTarget(SearchTestControl ctrl, ListView listView)
        {
            var collection = SearcherInTarget.ByType(TreeUtilityInTarget.LogicalTree(ctrl), typeof(Button).FullName);

            Assert.AreEqual(2, collection.Count());
            collection = SearcherInTarget.ByType <Button>(TreeUtilityInTarget.LogicalTree(ctrl));
            Assert.AreEqual(2, collection.Count());
            collection = SearcherInTarget.ByType <ButtonBase>(TreeUtilityInTarget.LogicalTree(ctrl));
            Assert.AreEqual(3, collection.Count());

            var list = SearcherInTarget.ByType(TreeUtilityInTarget.LogicalTree(ctrl), typeof(ListView).FullName).Single();

            Assert.AreEqual(list, listView);
            list = SearcherInTarget.ByType <ListView>(TreeUtilityInTarget.LogicalTree(ctrl)).Single();
            Assert.AreEqual(list, listView);
        }
        static void TestBindingInTarget(SearchTestControl ctrl, Button button1, TextBox textBox)
        {
            DependencyObject b = SearcherInTarget.ByBinding(TreeUtilityInTarget.LogicalTree(ctrl), "Button1Command").Single();
            Assert.AreEqual(button1, b);

            var collection = SearcherInTarget.ByBinding(TreeUtilityInTarget.LogicalTree(ctrl), "DataText");
            Assert.AreEqual(2, collection.Count());

            var t = SearcherInTarget.ByBinding(TreeUtilityInTarget.LogicalTree(ctrl), "DataText", ctrl.DataContext).Single();
            Assert.AreEqual(textBox, t);
        }
Exemple #9
0
 static string TestNameTextExtensionsInTarget(SearchTestControl ctrl)
 => ctrl.LogicalTree().ByType <FrameworkElement>().ByName("_listView").Single().Name;
Exemple #10
0
 static string TestTextExtensionsInTarget(SearchTestControl ctrl)
 => ctrl.LogicalTree().ByType <TextBlock>().ByText("AAA").Single().Name;
Exemple #11
0
 static string TestContentTextExtensionsInTarget(SearchTestControl ctrl)
 => ctrl.LogicalTree().ByType <ContentControl>().ByContentText("abc").Single().GetType().Name;
        static void TestTypeInTarget(SearchTestControl ctrl, ListView listView)
        {
            var collection = SearcherInTarget.ByType(TreeUtilityInTarget.LogicalTree(ctrl), typeof(Button).FullName);
            Assert.AreEqual(2, collection.Count());
            collection = SearcherInTarget.ByType<Button>(TreeUtilityInTarget.LogicalTree(ctrl));
            Assert.AreEqual(2, collection.Count());
            collection = SearcherInTarget.ByType<ButtonBase>(TreeUtilityInTarget.LogicalTree(ctrl));
            Assert.AreEqual(2, collection.Count());

            var list = SearcherInTarget.ByType(TreeUtilityInTarget.LogicalTree(ctrl), typeof(ListView).FullName).Single();
            Assert.AreEqual(list, listView);
            list = SearcherInTarget.ByType<ListView>(TreeUtilityInTarget.LogicalTree(ctrl)).Single();
            Assert.AreEqual(list, listView);
        }
        static void TestBindingExtensionsInTarget(SearchTestControl ctrl, Button button1, TextBox textBox)
        {
            DependencyObject b = ctrl.LogicalTree().ByBinding("Button1Command").Single();
            Assert.AreEqual(button1, b);

            var collection = ctrl.LogicalTree().ByBinding("DataText");
            Assert.AreEqual(2, collection.Count());

            var t = ctrl.LogicalTree().ByBinding("DataText", ctrl.DataContext).Single();
            Assert.AreEqual(textBox, t);
        }
 static void TestTypeExtensionsInTarget(SearchTestControl ctrl, ListView listView)
 {
     var collection = ctrl.LogicalTree().ByType(typeof(Button).FullName);
     Assert.AreEqual(2, collection.Count());
     collection = ctrl.LogicalTree().ByType<Button>();
     Assert.AreEqual(2, collection.Count());
     collection = ctrl.LogicalTree().ByType<ButtonBase>();
     Assert.AreEqual(2, collection.Count());
     var list = ctrl.LogicalTree().ByType(typeof(ListView).FullName).Single();
     Assert.AreEqual(list, listView);
     list = ctrl.LogicalTree().ByType <ListView>().Single();
     Assert.AreEqual(list, listView);
 }
 static void TestLogicalTreeInTargetExtensions(SearchTestControl ctrl, Button button1, ListView listView)
 {
     var b = ctrl.LogicalTree().ByBinding("Button1Command").Single();
     Assert.AreEqual(button1, b);
     Assert.AreEqual(0, listView.LogicalTree().ByType<ListViewItem>().Count());
 }
 static void TestLogicalTreeInTarget(SearchTestControl ctrl, Button button1, ListView listView)
 {
     var b = SearcherInTarget.ByBinding(TreeUtilityInTarget.LogicalTree(ctrl), "Button1Command").Single();
     Assert.AreEqual(button1, b);
     Assert.AreEqual(0, TreeUtilityInTarget.LogicalTree(listView).ByType<ListViewItem>().Count());
 }
 static SearchTestControl Init(Grid grid)
 {
     SearchTestControl ctrl = new SearchTestControl();
     grid.Children.Add(ctrl);
     return ctrl;
 }