Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        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());
        }
Beispiel #4
0
 static string TestNameTextExtensionsInTarget(SearchTestControl ctrl)
 => ctrl.LogicalTree().ByType <FrameworkElement>().ByName("_listView").Single().Name;
Beispiel #5
0
 static string TestTextExtensionsInTarget(SearchTestControl ctrl)
 => ctrl.LogicalTree().ByType <TextBlock>().ByText("AAA").Single().Name;
Beispiel #6
0
 static string TestContentTextExtensionsInTarget(SearchTestControl ctrl)
 => ctrl.LogicalTree().ByType <ContentControl>().ByContentText("abc").Single().GetType().Name;
 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 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 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);
        }