Ejemplo n.º 1
0
        AccountHierarchyWebAPISteps()
        {
            CustomerServiceConfig.SetupEnvironment();
            TPaaSServicesConfig.TPaaSTokenEndpoint = TokenService.GetTokenAPIEndpointUpdated(TPaaSServicesConfig.TPaaSTokenEndpoint, UserName, PassWord);
            accessToken = TokenService.GetAccessToken(TPaaSServicesConfig.TPaaSTokenEndpoint, "E4wERYf22xcMKVRTRQBtU6gkSqoa", "9NoQS8Tg01pXrtLp963Ap7BUvCga");

            CustomerHierarchyResponseByUserUID.Customers = new List <CustomerDetails>();
            CustomersForUserAccountDBResult.Customers    = new List <CustomerDetails>();
        }
Ejemplo n.º 2
0
 public void PostInValidDeleteRequestToService(string customerUid, string actionUtc, string contentType, HttpStatusCode actualResponse)
 {
     try
     {
         string accessToken = CustomerServiceConfig.GetValidUserAccessToken();
         LogResult.Report(Log, "log_ForInfo", "Posting the request with Valid Values: " + customerUid);
         ResponseString = RestClientUtil.DoInvalidHttpRequest(string.Format("{0}?CustomerUID={1}&ActionUTC={2}", CustomerServiceConfig.CustomerServiceEndpoint, customerUid, actionUtc),
                                                              HeaderSettings.DeleteMethod, accessToken,
                                                              contentType, null, actualResponse, HeaderSettings.BearerType, HeaderSettings.JsonMediaType);
     }
     catch (Exception e)
     {
         LogResult.Report(Log, "log_ForError", "Got Error While Posting Data To Customer Service", e);
         throw new Exception(e + " Got Error While Posting Data To Customer Service");
     }
 }
Ejemplo n.º 3
0
        public void PostValidUpdateRequestToService()
        {
            string requestString = JsonConvert.SerializeObject(UpdateCustomerModel);

            try
            {
                string accessToken = CustomerServiceConfig.GetValidUserAccessToken();
                LogResult.Report(Log, "log_ForInfo", "Posting the request with Valid Values: " + requestString);
                ResponseString = RestClientUtil.DoHttpRequest(CustomerServiceConfig.CustomerServiceEndpoint, HeaderSettings.PutMethod, accessToken,
                                                              HeaderSettings.JsonMediaType, requestString, HttpStatusCode.OK, HeaderSettings.BearerType, HeaderSettings.JsonMediaType);
            }
            catch (Exception e)
            {
                LogResult.Report(Log, "log_ForError", "Got Error While Posting Data To Customer Service", e);
                throw new Exception(e + " Got Error While Posting Data To Customer Service");
            }
        }
Ejemplo n.º 4
0
        public void PostInValidCustomerAssetAssociateRequestToService(string contentType, HttpStatusCode actualResponse)
        {
            string requestString = JsonConvert.SerializeObject(InvalidAssociateCustomerAssetModel);

            try
            {
                string accessToken = CustomerServiceConfig.GetValidUserAccessToken();
                LogResult.Report(Log, "log_ForInfo", "Posting the request with Valid Values: " + requestString);
                ResponseString = RestClientUtil.DoInvalidHttpRequest(CustomerServiceConfig.CustomerServiceEndpoint + "/AssociateCustomerAsset", HeaderSettings.PostMethod, accessToken,
                                                                     contentType, requestString, actualResponse, HeaderSettings.BearerType, HeaderSettings.JsonMediaType);
            }
            catch (Exception e)
            {
                LogResult.Report(Log, "log_ForError", "Got Error While Posting Data To customer Service", e);
                throw new Exception(e + " Got Error While Posting Data To customer Service");
            }
        }
Ejemplo n.º 5
0
        public void PostValidDeleteRequestToService(Guid customerUid, DateTime actionUtc)
        {
            string actionUtcString = actionUtc.ToString("yyyy-MM-ddThh:mm:ss");
            string customerUID     = customerUid.ToString();

            try
            {
                string accessToken = CustomerServiceConfig.GetValidUserAccessToken();
                LogResult.Report(Log, "log_ForInfo", "Posting the request with Valid Values: " + customerUID);
                ResponseString = RestClientUtil.DoHttpRequest(string.Format("{0}?CustomerUID={1}&ActionUTC={2}", CustomerServiceConfig.CustomerServiceEndpoint, customerUID, actionUtcString),
                                                              HeaderSettings.DeleteMethod, accessToken,
                                                              HeaderSettings.JsonMediaType, null, HttpStatusCode.OK, HeaderSettings.BearerType, HeaderSettings.JsonMediaType);
            }
            catch (Exception e)
            {
                LogResult.Report(Log, "log_ForError", "Got Error While Posting Data To Customer Service", e);
                throw new Exception(e + " Got Error While Posting Data To Customer Service");
            }
        }
Ejemplo n.º 6
0
 public CustomerServiceSupport(Log4Net myLog)
 {
     CustomerServiceConfig.SetupEnvironment();
     Log = myLog;
 }
Ejemplo n.º 7
0
 public AccountHierarchyServiceSupport(Log4Net myLog)
 {
     CustomerServiceConfig.SetupEnvironment();
     Log = myLog;
 }