public void CheckboxViewstateTextNull() { TestCheckBox c = new TestCheckBox(); c.Text = "text"; c.TrackState(); c.Text = null; Assert.AreEqual("", c.Text); object o = c.SaveState(); c = new TestCheckBox(); c.Text = "text"; c.TrackState(); c.LoadState(o); Assert.AreEqual("", c.Text); }
public void CheckboxViewstateValidation() { // for some reason, MS doesn't save the validation // properties to the viewstate for the Checkbox // control. why not? TestCheckBox o = new TestCheckBox(); o.ValidationGroup = "VG1"; o.CausesValidation = true; o.TrackState(); Assert.AreEqual("VG1", o.ValidationGroup, "V1"); Assert.IsTrue(o.CausesValidation, "V2"); object state = o.SaveState(); TestCheckBox copy = new TestCheckBox(); copy.LoadState(state); Assert.AreEqual("", copy.ValidationGroup, "V3"); Assert.IsFalse(copy.CausesValidation, "V4"); }
public void CheckboxViewstateValidation () { // for some reason, MS doesn't save the validation // properties to the viewstate for the Checkbox // control. why not? TestCheckBox o = new TestCheckBox (); o.ValidationGroup = "VG1"; o.CausesValidation = true; o.TrackState (); Assert.AreEqual ("VG1", o.ValidationGroup, "V1"); Assert.IsTrue (o.CausesValidation, "V2"); object state = o.SaveState (); TestCheckBox copy = new TestCheckBox (); copy.LoadState (state); Assert.AreEqual ("", copy.ValidationGroup, "V3"); Assert.IsFalse (copy.CausesValidation, "V4"); }
public void CheckboxViewstateTextNull () { TestCheckBox c = new TestCheckBox (); c.Text = "text"; c.TrackState (); c.Text = null; Assert.AreEqual ("", c.Text); object o = c.SaveState (); c = new TestCheckBox (); c.Text = "text"; c.TrackState (); c.LoadState (o); Assert.AreEqual ("", c.Text); }