public void DefaultsNotWorking() { CustomValidatorTestClass c = new CustomValidatorTestClass(); #if NET_2_0 Assert.AreEqual(false, c.ValidateEmptyText, "ValidateEmptyText"); #endif }
public void EmptyControlName() { Page page = new Page(); HtmlForm form = new HtmlForm(); CustomValidatorTestClass tc = new CustomValidatorTestClass(); page.Controls.Add(form); form.Controls.Add(tc); Assert.IsTrue(tc.AreControlPropertiesValid(), "#01"); }
public void Defaults() { CustomValidatorTestClass c; c = new CustomValidatorTestClass(); Assert.AreEqual(string.Empty, c.ClientValidationFunction, "D1"); c.ClientValidationFunction = "Hurra, hurra, die Schule brennt"; Assert.AreEqual("Hurra, hurra, die Schule brennt", c.ClientValidationFunction, "D1"); }
public void Render() { CustomValidatorTestClass c; TextBox t; c = new CustomValidatorTestClass(); StartValidationTest(c); t = SetValidationTextBox("textbox", "3"); c.Validate(); c.ErrorMessage = "aw shucks"; c.Display = ValidatorDisplay.Static; c.Enabled = true; c.EnableViewState = true; c.ClientValidationFunction = "Father to a sister of thought"; }
public void ValidateEmptyText() { CustomValidatorTestClass c = new CustomValidatorTestClass(); Page p = new Page(); TextBox tb = new TextBox(); tb.ID = "tb"; CustomValidator v = new CustomValidator(); v.ServerValidate += new ServerValidateEventHandler(ServerValidate); v.ControlToValidate = "tb"; p.Controls.Add(tb); p.Controls.Add(v); v.Validate(); Assert.AreEqual(false, checker, "Validate with ValidateEmptyText = false"); v.ValidateEmptyText = true; v.Validate(); Assert.AreEqual(true, checker, "Validate with ValidateEmptyText = true"); }
public void EventDefaults() { CustomValidatorTestClass c; TextBox t; c = new CustomValidatorTestClass(); Assert.AreEqual(true, c.Evaluate(), "E1"); Assert.AreEqual(false, bool_result, "E2"); c.ServerValidate += new ServerValidateEventHandler(ServerValidateMethod); bool_result = false; Assert.AreEqual(true, c.Evaluate(), "E3"); Assert.AreEqual(true, bool_result, "E4"); StartValidationTest(c); t = SetValidationTextBox("textbox", "3"); bool_result = false; Assert.AreEqual(true, c.Evaluate(), "E5"); Assert.AreEqual(true, bool_result, "E6"); }
public void Render() { CustomValidatorTestClass c; TextBox t; c = new CustomValidatorTestClass(); StartValidationTest(c); t = SetValidationTextBox("textbox", "3"); c.Validate(); c.ErrorMessage = "aw shucks"; c.Display = ValidatorDisplay.Static; c.Enabled = true; c.EnableViewState = true; #if !NET_2_0 Assert.AreEqual("<span style=\"color:Red;\">aw shucks</span>", c.Render(), "R1"); #endif c.ClientValidationFunction = "Father to a sister of thought"; #if !NET_2_0 Assert.AreEqual("<span style=\"color:Red;\">aw shucks</span>", c.Render(), "R2"); #endif }
public void EmptyControlName () { Page page = new Page (); HtmlForm form = new HtmlForm (); CustomValidatorTestClass tc = new CustomValidatorTestClass (); page.Controls.Add (form); form.Controls.Add (tc); Assert.IsTrue (tc.AreControlPropertiesValid (), "#01"); }
public void Render () { CustomValidatorTestClass c; TextBox t; c = new CustomValidatorTestClass(); StartValidationTest(c); t = SetValidationTextBox("textbox", "3"); c.Validate(); c.ErrorMessage = "aw shucks"; c.Display = ValidatorDisplay.Static; c.Enabled = true; c.EnableViewState = true; #if! NET_2_0 Assert.AreEqual("<span style=\"color:Red;\">aw shucks</span>", c.Render(), "R1"); #endif c.ClientValidationFunction = "Father to a sister of thought"; #if! NET_2_0 Assert.AreEqual("<span style=\"color:Red;\">aw shucks</span>", c.Render(), "R2"); #endif }
public void ValidateEmptyText () { CustomValidatorTestClass c = new CustomValidatorTestClass (); Page p = new Page (); TextBox tb = new TextBox (); tb.ID = "tb"; CustomValidator v = new CustomValidator (); v.ServerValidate += new ServerValidateEventHandler (ServerValidate); v.ControlToValidate = "tb"; p.Controls.Add (tb); p.Controls.Add (v); v.Validate (); Assert.AreEqual (false, checker, "Validate with ValidateEmptyText = false"); v.ValidateEmptyText = true; v.Validate (); Assert.AreEqual (true, checker, "Validate with ValidateEmptyText = true"); }
public void DefaultsNotWorking () { CustomValidatorTestClass c = new CustomValidatorTestClass (); #if NET_2_0 Assert.AreEqual (false, c.ValidateEmptyText, "ValidateEmptyText"); #endif }
public void Defaults () { CustomValidatorTestClass c; c= new CustomValidatorTestClass(); Assert.AreEqual(string.Empty, c.ClientValidationFunction , "D1"); c.ClientValidationFunction = "Hurra, hurra, die Schule brennt"; Assert.AreEqual("Hurra, hurra, die Schule brennt", c.ClientValidationFunction , "D1"); }
public void EventDefaults () { CustomValidatorTestClass c; TextBox t; c = new CustomValidatorTestClass(); Assert.AreEqual(true, c.Evaluate(), "E1"); Assert.AreEqual(false, bool_result, "E2"); c.ServerValidate += new ServerValidateEventHandler(ServerValidateMethod); bool_result = false; Assert.AreEqual(true, c.Evaluate(), "E3"); Assert.AreEqual(true, bool_result, "E4"); StartValidationTest(c); t = SetValidationTextBox("textbox", "3"); bool_result = false; Assert.AreEqual(true, c.Evaluate(), "E5"); Assert.AreEqual(true, bool_result, "E6"); }
public void Render () { CustomValidatorTestClass c; TextBox t; c = new CustomValidatorTestClass(); StartValidationTest(c); t = SetValidationTextBox("textbox", "3"); c.Validate(); c.ErrorMessage = "aw shucks"; c.Display = ValidatorDisplay.Static; c.Enabled = true; c.EnableViewState = true; c.ClientValidationFunction = "Father to a sister of thought"; }