コード例 #1
0
        public void RubberStamp_Conditions_IsValidEmailFormatCondition_Valid_Email_With_Dot_After_Name_Test()
        {
            var condition = new IsValidEmailFormatCondition <TestClass, string>(p => p.Email);

            Assert.IsTrue(condition.IsValid(new TestClass {
                Email = "*****@*****.**"
            }));
        }
コード例 #2
0
        public void RubberStamp_Conditions_IsValidEmailFormatCondition_Valid_Email_With_Number_Test()
        {
            var condition = new IsValidEmailFormatCondition <TestClass, string>(p => p.Email);

            Assert.IsTrue(condition.IsValid(new TestClass {
                Email = "[email protected]"
            }));
        }
コード例 #3
0
        public void RubberStamp_Conditions_IsValidEmailFormatCondition_Valid_Email_With_MUlti_Dot_Test()
        {
            var condition = new IsValidEmailFormatCondition <TestClass, string>(p => p.Email);

            Assert.IsTrue(condition.IsValid(new TestClass {
                Email = "*****@*****.**"
            }));
        }
コード例 #4
0
        public void RubberStamp_Conditions_IsValidEmailFormatCondition_Valid_Email_With_Special_Character_In_Name_Test()
        {
            var condition = new IsValidEmailFormatCondition <TestClass, string>(p => p.Email);

            Assert.IsTrue(condition.IsValid(new TestClass {
                Email = "*****@*****.**"
            }));
        }
コード例 #5
0
        public void RubberStamp_Conditions_IsValidEmailFormatCondition_InValid_Email_Without_Sign_Test()
        {
            var condition = new IsValidEmailFormatCondition <TestClass, string>(p => p.Email);

            Assert.IsFalse(condition.IsValid(new TestClass {
                Email = "email.example.com"
            }));
        }
コード例 #6
0
        public void RubberStamp_Conditions_IsValidEmailFormatCondition_InValid_Email_With_Special_Characters_Test()
        {
            var condition = new IsValidEmailFormatCondition <TestClass, string>(p => p.Email);

            Assert.IsFalse(condition.IsValid(new TestClass {
                Email = "#@%^%#$@#$@#.com"
            }));
        }
コード例 #7
0
        public void RubberStamp_Conditions_IsValidEmailFormatCondition_InValid_Email_Without_Domain_Test()
        {
            var condition = new IsValidEmailFormatCondition <TestClass, string>(p => p.Email);

            Assert.IsFalse(condition.IsValid(new TestClass {
                Email = "PlainAddress"
            }));
        }
コード例 #8
0
        public void RubberStamp_Conditions_IsValidEmailFormatCondition_InValid_Email_With_Domain_Without_Dot_Test()
        {
            var condition = new IsValidEmailFormatCondition <TestClass, string>(p => p.Email);

            Assert.IsFalse(condition.IsValid(new TestClass {
                Email = "JoeSmith@localhost"
            }));
        }
コード例 #9
0
        public void RubberStamp_Conditions_IsValidEmailFormatCondition_Invalid_Email_With_SpecialCharacters_Test()
        {
            var condition = new IsValidEmailFormatCondition <TestClass, string>(p => p.Email);

            Assert.IsFalse(condition.IsValid(new TestClass {
                Email = "!#$%&'*+-/=?^_`{|}~\"(),:;<>@[\\]@example.org"
            }));
        }
コード例 #10
0
        public void RubberStamp_Conditions_IsValidEmailFormatCondition_Valid_Email_With_Long_Name_Test()
        {
            var email = new StringBuilder();

            while (email.Length <= 255)
            {
                email.Append('x');
            }

            email.Append("@example.com");

            var condition = new IsValidEmailFormatCondition <TestClass, string>(p => p.Email);

            Assert.IsTrue(condition.IsValid(new TestClass {
                Email = email.ToString()
            }));
        }