Exemplo n.º 1
0
        public void PeekProperties()
        {
            ConcreteButtonBase cc = new ConcreteButtonBase();

            Assert.IsNotNull(cc.DefaultStyleKey_, "DefaultStyleKey");
            Assert.AreEqual(typeof(ContentControl), cc.DefaultStyleKey_, "DefaultStyleKey/Type");
        }
Exemplo n.º 2
0
        public void Events()
        {
            ConcreteButtonBase bb = new ConcreteButtonBase();

            bb.Click += delegate(object sender, RoutedEventArgs e) {
                Assert.AreSame(bb, sender, "sender");
                Assert.AreSame(bb, e.OriginalSource, "OriginalSource");
            };
            bb.OnClick_();
        }
Exemplo n.º 3
0
        public void Properties()
        {
            ConcreteButtonBase bb = new ConcreteButtonBase();

            bb.SetIsPressed(true);
            Assert.IsTrue(bb.IsPressed, "IsPressed-1");
            Assert.IsFalse(bb.IsPressedChangedOldValue, "IsPressed-1/OldValue");
            Assert.IsTrue(bb.IsPressedChangedNewValue, "IsPressed-1/NewValue");
            bb.SetIsPressed(false);
            Assert.IsFalse(bb.IsPressed, "IsPressed-2");
            Assert.IsTrue(bb.IsPressedChangedOldValue, "IsPressed-2/OldValue");
            Assert.IsFalse(bb.IsPressedChangedNewValue, "IsPressed-2/NewValue");

            bb.ClickMode = ClickMode.Hover;
            Assert.AreEqual(ClickMode.Hover, bb.ClickMode, "ClickMode/Hover");
            bb.ClickMode = ClickMode.Press;
            Assert.AreEqual(ClickMode.Press, bb.ClickMode, "ClickMode/Press");
            bb.ClickMode = ClickMode.Release;
            Assert.AreEqual(ClickMode.Release, bb.ClickMode, "ClickMode/Release");

            Assert.Throws <ArgumentException> (delegate {
                bb.ClickMode = (ClickMode)Int32.MinValue;
            });
        }
Exemplo n.º 4
0
		public void Events ()
		{
			ConcreteButtonBase bb = new ConcreteButtonBase ();
			bb.Click += delegate (object sender, RoutedEventArgs e) {
				Assert.AreSame (bb, sender, "sender");
				Assert.AreSame (bb, e.OriginalSource, "OriginalSource");
			};
			bb.OnClick_ ();
		}
Exemplo n.º 5
0
		public void DefaultMethods ()
		{
			ConcreteButtonBase bb = new ConcreteButtonBase ();
			ControlTest.CheckDefaultMethods (bb);
		}
Exemplo n.º 6
0
		public void PeekProperties ()
		{
			ConcreteButtonBase cc = new ConcreteButtonBase ();
			Assert.IsNotNull (cc.DefaultStyleKey_, "DefaultStyleKey");
			Assert.AreEqual (typeof (ContentControl), cc.DefaultStyleKey_, "DefaultStyleKey/Type");
		}
Exemplo n.º 7
0
		public void Properties ()
		{
			ConcreteButtonBase bb = new ConcreteButtonBase ();

			bb.SetIsPressed (true);
			Assert.IsTrue (bb.IsPressed, "IsPressed-1");
			Assert.IsFalse (bb.IsPressedChangedOldValue, "IsPressed-1/OldValue");
			Assert.IsTrue (bb.IsPressedChangedNewValue, "IsPressed-1/NewValue");
			bb.SetIsPressed (false);
			Assert.IsFalse (bb.IsPressed, "IsPressed-2");
			Assert.IsTrue (bb.IsPressedChangedOldValue, "IsPressed-2/OldValue");
			Assert.IsFalse (bb.IsPressedChangedNewValue, "IsPressed-2/NewValue");

			bb.ClickMode = ClickMode.Hover;
			Assert.AreEqual (ClickMode.Hover, bb.ClickMode, "ClickMode/Hover");
			bb.ClickMode = ClickMode.Press;
			Assert.AreEqual (ClickMode.Press, bb.ClickMode, "ClickMode/Press");
			bb.ClickMode = ClickMode.Release;
			Assert.AreEqual (ClickMode.Release, bb.ClickMode, "ClickMode/Release");

			Assert.Throws<ArgumentException> (delegate {
				bb.ClickMode = (ClickMode) Int32.MinValue;
			});
		}
Exemplo n.º 8
0
        public void DefaultMethods()
        {
            ConcreteButtonBase bb = new ConcreteButtonBase();

            ControlTest.CheckDefaultMethods(bb);
        }