public void TestAddressDoesntHaveStreet()
        {
            var address = new Address {City = "St. Paul", PostalCode = "55117", StateCode = "MN" };
            AddressValidator validator = new AddressValidator();

            List<string> errors = new List<string>();

            errors = validator.validateAddress(address);

            Assert.AreNotEqual(0, errors.Count);
        }
        public void TestAddressDoesntHaveValidPostalCode()
        {
            var address = new Address { Street1 = "123 Main St.", City = "St. Paul", PostalCode = "fivefivefivefive", StateCode = "MN" };
            AddressValidator validator = new AddressValidator();

            List<string> errors = new List<string>();

            errors = validator.validateAddress(address);

            Assert.AreNotEqual(0, errors.Count);
        }
Esempio n. 3
0
 public Company()
 {
     Address = new Address();
 }
        public void TestAddressIsEmpty()
        {
            var address = new Address();
            AddressValidator validator = new AddressValidator();

            List<string> errors = new List<string>();

            errors = validator.validateAddress(address);

            Assert.AreNotEqual(0, errors.Count);
        }
        public void TestValidAddressPasses()
        {
            var address = new Address { Street1 = "123 Main St.", City = "St. Paul", PostalCode = "55117", StateCode = "MN" };
               AddressValidator validator = new AddressValidator();

               List<string> errors = new List<string>();

               errors = validator.validateAddress(address);

               Assert.AreEqual(0, errors.Count);
        }