Ejemplo n.º 1
0
        public void EnsureVisible()
        {
            listBox.EnsureVisible(99);
            dynamic item = listBox.Dynamic().ItemContainerGenerator.ContainerFromIndex(99);

            Assert.IsFalse((bool)app.Type <object>().ReferenceEquals(null, item));
        }
Ejemplo n.º 2
0
        public void TestSize()
        {
            var  selector = new WPFListBox(target);
            Size size     = selector.Dynamic().RenderSize;

            Assert.AreEqual(new System.Drawing.Size((int)size.Width, (int)size.Height), selector.Size);
        }
Ejemplo n.º 3
0
        public void TestPointToScreen()
        {
            var   selector = new WPFListBox(target);
            Point size     = selector.Dynamic().PointToScreen(new Point());

            Assert.AreEqual(new System.Drawing.Point((int)size.X, (int)size.Y), selector.PointToScreen(new System.Drawing.Point()));
        }
Ejemplo n.º 4
0
        public void TestIsEnabled()
        {
            var selector = new WPFListBox(target);

            Assert.IsTrue(selector.IsEnabled);
            selector.Dynamic().IsEnabled = false;
            Assert.IsFalse(selector.IsEnabled);
        }
Ejemplo n.º 5
0
        public void TestVisibility()
        {
            var selector = new WPFListBox(target);

            Assert.AreEqual(Visibility.Visible, selector.Visibility);
            selector.Dynamic().Visibility = Visibility.Hidden;
            Assert.AreEqual(Visibility.Hidden, selector.Visibility);
        }
 public void TestIsEnabled()
 {
     var win = app.Type(typeof(Application)).Current.MainWindow;
     var selector = new WPFListBox(target);
     Assert.IsTrue(selector.IsEnabled);
     selector.Dynamic().IsEnabled = false;
     Assert.IsFalse(selector.IsEnabled);
 }
 public void TestVisibility()
 {
     var win = app.Type(typeof(Application)).Current.MainWindow;
     var selector = new WPFListBox(target);
     Assert.AreEqual(Visibility.Visible, selector.Visibility);
     selector.Dynamic().Visibility = Visibility.Hidden;
     Assert.AreEqual(Visibility.Hidden, selector.Visibility);
 }
Ejemplo n.º 8
0
        public void TestActivate()
        {
            var win    = new WindowControl(app.Type(typeof(Application)).Current.MainWindow);
            var newWin = app.Type <Window>()();

            newWin.Show();
            var selector = new WPFListBox(target);

            selector.Activate();

            Assert.AreEqual(WindowControl.FromZTop(app).Handle, win.Handle);
            Assert.IsTrue((bool)selector.Dynamic().IsFocused);
            newWin.Close();
        }