Exemplo n.º 1
0
        public string CustomerRentsCar(string carCategory, string customerSocialSecurityNumber, decimal currentMilage)
        {
            if (!CarCategories.IsOfThisType(carCategory))
            {
                throw new ArgumentNullException("carCategory");
            }
            if (!SocialSecurityNumber.IsValid(customerSocialSecurityNumber))
            {
                throw new ArgumentNullException("customerSocialSecurityNumber");
            }

            return(CreateAndSaveACarRental(carCategory, customerSocialSecurityNumber, currentMilage));
        }
 public void Ssn_Invalid(string ssn)
 {
     Assert.False(SocialSecurityNumber.IsValid(ssn));
 }
 public void Ssn_Valid(string ssn)
 {
     Assert.True(SocialSecurityNumber.IsValid(ssn));
 }
Exemplo n.º 4
0
 public void ShouldFailTheseSocialSecurityNumbers(string input)
 {
     Assert.IsFalse(SocialSecurityNumber.IsValid(input), input);
 }
Exemplo n.º 5
0
 public void ShouldPassTheseSocialSecurityNumbers(string input)
 {
     Assert.IsTrue(SocialSecurityNumber.IsValid(input), input);
 }