public void GetControlValidationValue() { BaseValidatorPoker p = new BaseValidatorPoker(); StartValidationTest(p); TextBox box = AddTextBox("textbox", "hello world"); Label label = new Label(); label.ID = "label"; Page.Controls.Add(label); /* successful */ Assert.AreEqual("hello world", p.DoGetControlValidationValue("textbox"), "C1"); /* failure (non-existant control)*/ Assert.IsNull(p.DoGetControlValidationValue("textbox2"), "C2"); /* failure (control without a ValidationProperty */ Assert.IsNull(p.DoGetControlValidationValue("label"), "C3"); StopValidationTest(); }
public void NullValidationProperty() { BaseValidatorPoker v = new BaseValidatorPoker(); Page p = new Page(); p.Controls.Add(v); RadioButtonList l = new RadioButtonList(); p.Controls.Add(l); l.ID = "XXX"; v.ControlToValidate = "XXX"; Assert.AreEqual(String.Empty, v.DoGetControlValidationValue("XXX"), "#A1"); }
public void ValidationProperty() { BaseValidatorPoker p = new BaseValidatorPoker(); PropertyDescriptor d; StartValidationTest(p); TextBox box = AddTextBox("textbox", "hello world"); d = p.GetValidationProperty(box); Assert.AreEqual("Text", d.Name, "A1"); Assert.AreEqual("hello world", p.DoGetControlValidationValue("textbox"), "A2"); StopValidationTest(); }
public void GetControlValidationValue () { BaseValidatorPoker p = new BaseValidatorPoker (); StartValidationTest (p); TextBox box = AddTextBox ("textbox", "hello world"); Label label = new Label (); label.ID = "label"; Page.Controls.Add (label); /* successful */ Assert.AreEqual ("hello world", p.DoGetControlValidationValue ("textbox"), "C1"); /* failure (non-existant control)*/ Assert.IsNull (p.DoGetControlValidationValue ("textbox2"), "C2"); /* failure (control without a ValidationProperty */ Assert.IsNull (p.DoGetControlValidationValue ("label"), "C3"); StopValidationTest (); }
public void NullValidationProperty () { BaseValidatorPoker v = new BaseValidatorPoker (); Page p = new Page (); p.Controls.Add (v); RadioButtonList l = new RadioButtonList (); p.Controls.Add (l); l.ID = "XXX"; v.ControlToValidate = "XXX"; Assert.AreEqual (String.Empty, v.DoGetControlValidationValue ("XXX"), "#A1"); }
public void ValidationProperty () { BaseValidatorPoker p = new BaseValidatorPoker (); PropertyDescriptor d; StartValidationTest (p); TextBox box = AddTextBox ("textbox", "hello world"); d = p.GetValidationProperty (box); Assert.AreEqual ("Text", d.Name, "A1"); Assert.AreEqual ("hello world", p.DoGetControlValidationValue ("textbox"), "A2"); StopValidationTest (); }