Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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");
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
		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 ();
		}
Esempio n. 5
0
		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");
		}
Esempio n. 6
0
		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 ();
		}