Exemple #1
0
        public void RegExSSN()
        {
            Csla.ApplicationContext.GlobalContext.Clear();
            UnitTestContext context = GetContext();

            HasRegEx root = new HasRegEx();

            root.Ssn  = "555-55-5555";
            root.Ssn2 = "555-55-5555";
            context.Assert.IsTrue(root.IsValid, "Ssn should be valid");

            root.Ssn = "555-55-5555d";
            context.Assert.IsFalse(root.IsValid, "Ssn should not be valid");

            root.Ssn  = "555-55-5555";
            root.Ssn2 = "555-55-5555d";
            context.Assert.IsFalse(root.IsValid, "Ssn should not be valid");

            context.Assert.Success();
            context.Complete();
        }
Exemple #2
0
        public void RegExSSN()
        {
            TestResults.Reinitialise();
            UnitTestContext context = GetContext();

            HasRegEx root = CreateWithoutCriteria <HasRegEx>();

            root.Ssn  = "555-55-5555";
            root.Ssn2 = "555-55-5555";
            context.Assert.IsTrue(root.IsValid, "Ssn should be valid");

            root.Ssn = "555-55-5555d";
            context.Assert.IsFalse(root.IsValid, "Ssn should not be valid");

            root.Ssn  = "555-55-5555";
            root.Ssn2 = "555-55-5555d";
            context.Assert.IsFalse(root.IsValid, "Ssn should not be valid");

            context.Assert.Success();
            context.Complete();
        }