예제 #1
0
        public void GetErrorMessageTest()
        {
            var model = new RegexValidatorModelTest
            {
                YourEmail = "yaoaiabab@bjkalglk@kjnjkiu",
            };

            Assert.IsInstanceOfType(validator.Validate(model), typeof(bool));
            Assert.AreEqual(1, validator.GetErrorMessages().Count);
        }
예제 #2
0
        public void ValidateTest()
        {
            var model = new RegexValidatorModelTest
            {
                YourEmail = "*****@*****.**",
            };

            Assert.IsTrue(validator.Validate(model));

            model.YourEmail = "niugeiuhvrhbyfygmn";
            Assert.IsFalse(validator.Validate(model));
        }