Esempio n. 1
0
        public void InitializedAddressWithJustStreetAddress()
        {
            string streetAddress = "123 Anywhere St";
            Address address = new Address(streetAddress);

            Assert.Equal(streetAddress, address.Street);
        }
Esempio n. 2
0
        public void InitializedAddressWithStreetAndCity()
        {
            string street = "123 Anywhere St";
            string city = "Somewhere";

            string streetAndCityAddress = street + ", " + city;
            Address address = new Address(streetAndCityAddress);

            Assert.Equal(street, address.Street);
            Assert.Equal(city, address.City);
        }
Esempio n. 3
0
        public void InitializedAddressWithStreetCityStateZip()
        {
            string street = "123 Anywhere St";
            string city = "Somewhere";
            string state = "AZ";
            string zip = "98765";

            string streetCityState = street + ", " + city + ", " + state + " " + zip;
            Address address = new Address(streetCityState);

            Assert.Equal(street, address.Street);
            Assert.Equal(city, address.City);
            Assert.Equal(state, address.State);
            Assert.Equal(zip, address.Zip);
        }
Esempio n. 4
0
        public void InitializedAddressWithStreetCityAndState()
        {
            string street = "123 Anywhere St";
            string city = "Somewhere";
            string state = "AZ";

            string streetCityState = street + ", " + city + ", " + state;
            Address address = new Address(streetCityState);

            Assert.Equal(street, address.Street);
            Assert.Equal(city, address.City);
            Assert.Equal(state, address.State);
        }
Esempio n. 5
0
        public void InitializedAddressHasEmptyZip()
        {
            Address address = new Address();

            Assert.Null(address.Zip);
        }
Esempio n. 6
0
        public void InitializedAddressHasEmptyStreet()
        {
            Address address = new Address();

            Assert.Equal(string.Empty, address.Street);
        }
Esempio n. 7
0
        public void InitializedAddressHasEmptyCity()
        {
            Address address = new Address();

            Assert.Equal(string.Empty, address.City);
        }
Esempio n. 8
0
        public void InitializedAddresZipOnlyAceptsValidValues()
        {
            string badZip = "asdfg";
            string goodZip = "44331";

            Address address = new Address();

            address.Zip = badZip;
            Assert.Null(address.Zip);

            address.Zip = goodZip;
            Assert.Equal(goodZip, address.Zip);
        }