Exemplo 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();
        }
Exemplo 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");
        }
Exemplo 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();
        }
Exemplo 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 ();
		}
Exemplo 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");
		}
Exemplo 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 ();
		}