Пример #1
0
        private void UpdateDeliveryAddressFrom(DeliveryAddressView deliveryAddressSource, DeliveryAddress deliveryAddressToUpdate)
        {
            deliveryAddressToUpdate.Name        = deliveryAddressSource.Name;
            deliveryAddressToUpdate.AddressLine = deliveryAddressSource.AddressLine;
            deliveryAddressToUpdate.City        = deliveryAddressSource.City;
            deliveryAddressToUpdate.State       = deliveryAddressSource.State;
            deliveryAddressToUpdate.Country     = deliveryAddressSource.Country;
            deliveryAddressToUpdate.ZipCode     = deliveryAddressSource.ZipCode;

            deliveryAddressToUpdate.ThrowExceptionIfInvalid();
        }
        public void ThenAnInvalidAddressExceptionWillBeThrown()
        {
            DeliveryAddress invalidAddress = new DeliveryAddress()
            {
                AddressLine = string.Empty,
                City        = "City",
                State       = "State",
                Country     = "Country",
                ZipCode     = "PostCode",
                Name        = "Home",
                Customer    = new Customer()
            };

            invalidAddress.ThrowExceptionIfInvalid();
        }