示例#1
0
        public CarrierDetail GetCarrierDetails(string carrierName)
        {
            CarrierDetail carrierDetail = null;

            try
            {
                string jsonResponse = DataLayer.getResponseFromApi(ApiKey, DataLayer.WebMethod.GET, $"/meta/carrier/{carrierName}");

                ZkSuccess zkSuccess = GetApiCallSuccess(jsonResponse);
                if (zkSuccess.success == true)
                {
                    carrierDetail = JsonConvert.DeserializeObject <CarrierDetail>(jsonResponse);
                }
                else
                {
                    throw new Exception(zkSuccess.error_message + " " + zkSuccess.detail);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(carrierDetail);
        }
        public void GetCarrierDetailsTest()
        {
            CarrierDetail fedexDetails = zkMetadataService.GetCarrierDetails("fedex");

            Assert.IsTrue(fedexDetails != null);
        }