Exemplo n.º 1
0
        public string CreateAddress(Address address, ResultsObject ro)
        {
            string addressId = string.Empty;
            string personId  = _apiClient.GetPersonId(ro.ReferenceNumber);

            if (!string.IsNullOrEmpty(personId))
            {
                bool otherActiveAddresses = _apiClient.CheckForOtherActiveAddresses(personId);

                if (otherActiveAddresses)
                {
                    _apiClient.SetOtherAddressesToInactive(ro);
                }

                addressId = _apiClient.CreateAddress(address, ro);
                if (!string.IsNullOrEmpty(addressId))
                {
                    _apiClient.CreatePersonAddress(addressId, personId, ro);
                }
            }
            return(addressId);
        }
        public void CheckForOtherActiveAddresses()
        {
            bool otherActiveAddresses = _dataApiClient.CheckForOtherActiveAddresses(_testPersonId);

            Assert.IsTrue(otherActiveAddresses);
        }