Exemplo n.º 1
0
        public void REValidator_ValidationTests()
        {
            REValidatorPoker p = new REValidatorPoker();
            TextBox          box;

            StartValidationTest(p);

            p.ValidationExpression = "\\d{5}";
            box = SetValidationTextBox("textbox", "94117");
            Assert.IsTrue(p.DoEvaluateIsValid(), "B1");

            box.Text = "9410";
            Assert.IsFalse(p.DoEvaluateIsValid(), "B2");

            box.Text = "12345 ";
            Assert.IsFalse(p.DoEvaluateIsValid(), "B3");

            box.Text = " 12345";
            Assert.IsFalse(p.DoEvaluateIsValid(), "B4");

            box.Text = " 12345 ";
            Assert.IsFalse(p.DoEvaluateIsValid(), "B5");

            p.ValidationExpression = "^\\d{5}$";
            box.Text = "12345";
            Assert.IsTrue(p.DoEvaluateIsValid(), "B6");

            StopValidationTest();
        }
Exemplo n.º 2
0
		public void REValidator_ViewState ()
		{
			REValidatorPoker p = new REValidatorPoker ();

			Assert.AreEqual (p.ValidationExpression, String.Empty, "A1");

			p.ValidationExpression = "\\d{5}";
			Assert.AreEqual ("\\d{5}", p.ValidationExpression, "A2");

			object state = p.SaveState ();

			REValidatorPoker copy = new REValidatorPoker ();
			copy.LoadState (state);
			Assert.AreEqual ("\\d{5}", copy.ValidationExpression, "A3");
		}
Exemplo n.º 3
0
        public void REValidator_ViewState()
        {
            REValidatorPoker p = new REValidatorPoker();

            Assert.AreEqual(p.ValidationExpression, String.Empty, "A1");

            p.ValidationExpression = "\\d{5}";
            Assert.AreEqual("\\d{5}", p.ValidationExpression, "A2");

            object state = p.SaveState();

            REValidatorPoker copy = new REValidatorPoker();

            copy.LoadState(state);
            Assert.AreEqual("\\d{5}", copy.ValidationExpression, "A3");
        }
Exemplo n.º 4
0
		public void REValidator_ValidationTests ()
		{
			REValidatorPoker p = new REValidatorPoker ();
			TextBox box;

			StartValidationTest (p);

			p.ValidationExpression = "\\d{5}";
			box = SetValidationTextBox ("textbox", "94117");
			Assert.IsTrue (p.DoEvaluateIsValid (), "B1");

			box.Text = "9410";
			Assert.IsFalse (p.DoEvaluateIsValid (), "B2");
			
			box.Text = "12345 ";
			Assert.IsFalse (p.DoEvaluateIsValid (), "B3");

			box.Text = " 12345";
			Assert.IsFalse (p.DoEvaluateIsValid (), "B4");
			
			box.Text = " 12345 ";
			Assert.IsFalse (p.DoEvaluateIsValid (), "B5");
			
			p.ValidationExpression = "^\\d{5}$";
			box.Text = "12345";
			Assert.IsTrue (p.DoEvaluateIsValid (), "B6");

			StopValidationTest();
		}