public void DefaultProperties () { ConcreteDependencyObject dobj = new ConcreteDependencyObject (); // default properties on DependencyObject... CheckDefaultProperties (dobj); }
public void DefaultProperties() { ConcreteDependencyObject dobj = new ConcreteDependencyObject(); // default properties on DependencyObject... CheckDefaultProperties(dobj); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }