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

            Assert.Equal(streetAddress, address.Street);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo n.º 5
0
        public void InitializedAddressHasEmptyZip()
        {
            Address address = new Address();

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

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

            Assert.Equal(string.Empty, address.City);
        }
Ejemplo 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);
        }