Exemple #1
0
		public void DefaultProperties ()
		{
			ConcreteDependencyObject dobj = new ConcreteDependencyObject ();

			// default properties on DependencyObject...
			CheckDefaultProperties (dobj);
		}
Exemple #2
0
        public void DefaultProperties()
        {
            ConcreteDependencyObject dobj = new ConcreteDependencyObject();

            // default properties on DependencyObject...
            CheckDefaultProperties(dobj);
        }
Exemple #3
0
		public void GetIsInputMethodEnabled_Validations ()
		{
			Assert.Throws<ArgumentNullException> (delegate {
				InputMethod.GetIsInputMethodEnabled (null);
			}, "null");

			ConcreteDependencyObject cdo = new ConcreteDependencyObject ();
			Assert.Throws<ArgumentException> (delegate {
				InputMethod.GetIsInputMethodEnabled (cdo);
			}, "not a TextBox");
		}
Exemple #4
0
        public void GetIsInputMethodEnabled_Validations()
        {
            Assert.Throws <ArgumentNullException> (delegate {
                InputMethod.GetIsInputMethodEnabled(null);
            }, "null");

            ConcreteDependencyObject cdo = new ConcreteDependencyObject();

            Assert.Throws <ArgumentException> (delegate {
                InputMethod.GetIsInputMethodEnabled(cdo);
            }, "not a TextBox");
        }
Exemple #5
0
		public void GetValue ()
		{
			ConcreteDependencyObject cdo = new ConcreteDependencyObject ();
			Assert.Throws<Exception> (delegate {
				cdo.GetValue (InputMethod.IsInputMethodEnabledProperty);
			}, "GetValue");

			TextBox tb = new TextBox ();
			Assert.IsTrue ((bool) tb.GetValue (InputMethod.IsInputMethodEnabledProperty), "TextBox");

			MyTextBox mtb = new MyTextBox ();
			Assert.IsTrue ((bool) mtb.GetValue (InputMethod.IsInputMethodEnabledProperty), "MyTextBox");
		}
Exemple #6
0
        public void GetValue()
        {
            ConcreteDependencyObject cdo = new ConcreteDependencyObject();

            Assert.Throws <Exception> (delegate {
                cdo.GetValue(InputMethod.IsInputMethodEnabledProperty);
            }, "GetValue");

            TextBox tb = new TextBox();

            Assert.IsTrue((bool)tb.GetValue(InputMethod.IsInputMethodEnabledProperty), "TextBox");

            MyTextBox mtb = new MyTextBox();

            Assert.IsTrue((bool)mtb.GetValue(InputMethod.IsInputMethodEnabledProperty), "MyTextBox");
        }
Exemple #7
0
		public void SetIsInputMethodEnabled_Validations ()
		{
			Assert.Throws<ArgumentNullException> (delegate {
				InputMethod.SetIsInputMethodEnabled (null, true);
			}, "null,true");
			Assert.Throws<ArgumentNullException> (delegate {
				InputMethod.SetIsInputMethodEnabled (null, false);
			}, "null,false");

			ConcreteDependencyObject cdo = new ConcreteDependencyObject ();
			Assert.Throws<ArgumentException> (delegate {
				InputMethod.SetIsInputMethodEnabled (cdo, true);
			}, "not a TextBox, true");
			Assert.Throws<ArgumentException> (delegate {
				InputMethod.SetIsInputMethodEnabled (cdo, false);
			}, "not a TextBox, false");
		}
Exemple #8
0
        public void SetIsInputMethodEnabled_Validations()
        {
            Assert.Throws <ArgumentNullException> (delegate {
                InputMethod.SetIsInputMethodEnabled(null, true);
            }, "null,true");
            Assert.Throws <ArgumentNullException> (delegate {
                InputMethod.SetIsInputMethodEnabled(null, false);
            }, "null,false");

            ConcreteDependencyObject cdo = new ConcreteDependencyObject();

            Assert.Throws <ArgumentException> (delegate {
                InputMethod.SetIsInputMethodEnabled(cdo, true);
            }, "not a TextBox, true");
            Assert.Throws <ArgumentException> (delegate {
                InputMethod.SetIsInputMethodEnabled(cdo, false);
            }, "not a TextBox, false");
        }
Exemple #9
0
        public void SetValue()
        {
            ConcreteDependencyObject cdo = new ConcreteDependencyObject();

            Assert.Throws <Exception> (delegate {
                cdo.SetValue(InputMethod.IsInputMethodEnabledProperty, true);
            }, "SetValue");

            TextBox tb = new TextBox();

            tb.SetValue(InputMethod.IsInputMethodEnabledProperty, false);
            Assert.IsFalse(InputMethod.GetIsInputMethodEnabled(tb), "TextBox");

            MyTextBox mtb = new MyTextBox();

            mtb.SetValue(InputMethod.IsInputMethodEnabledProperty, false);
            Assert.IsFalse(InputMethod.GetIsInputMethodEnabled(mtb), "MyTextBox");
        }
Exemple #10
0
		public void ParentTest ()
		{
			ConcreteDependencyObject o = new ConcreteDependencyObject ();
			Canvas c = new Canvas ();
			c.Resources.Add ("key", o);
			Assert.Throws<InvalidOperationException> (() => c.Resources.Add ("key2", o), "Can't add to same collection twice");

			Canvas c2 = new Canvas ();
			Assert.Throws<InvalidOperationException> (() => c2.Resources.Add ("key", o), "Can't add to two different collections");
		}
Exemple #11
0
		public void SetValue ()
		{
			ConcreteDependencyObject cdo = new ConcreteDependencyObject ();
			Assert.Throws<Exception> (delegate {
				cdo.SetValue (InputMethod.IsInputMethodEnabledProperty, true);
			}, "SetValue");

			TextBox tb = new TextBox ();
			tb.SetValue (InputMethod.IsInputMethodEnabledProperty, false);
			Assert.IsFalse (InputMethod.GetIsInputMethodEnabled (tb), "TextBox");

			MyTextBox mtb = new MyTextBox ();
			mtb.SetValue (InputMethod.IsInputMethodEnabledProperty, false);
			Assert.IsFalse (InputMethod.GetIsInputMethodEnabled (mtb), "MyTextBox");
		}