Example #1
0
        public void step_08()
        {
            SubscriberService.SubscriberInterface    si         = new SubscriberInterfaceClient();
            SubscriberService.getServicesListRequest getRequest = new getServicesListRequest();
            ban = ReaderTestData.ReadExel(testName, "BAN105");
            ctn = ReaderTestData.ReadExel(testName, "ctn105");
            getRequest.token = token;
            getRequest.ban   = ban;
            getRequest.ctn   = ctn;
            try
            {
                Logger.PrintAction("Получение информации о ctn", "Не аутентифицированный");
                SubscriberService.getServicesListResponse requestResponse = si.getServicesList(getRequest);
                var s = requestResponse.servicesList;

                if (s[0] != null)
                {
                    Logger.PrintRezult(false, "Метод отрабатывает");
                    globalR = false;
                }
            }
            catch (FaultException <UssWsApiException> exception)
            {
                if (exception.Detail.errorCode == 20006 && exception.Detail.errorDescription == "FORBIDDEN (login="******")")
                {
                    Logger.PrintRezult(true, "Код ошибки корректный " + exception.Detail.errorDescription + " " + exception.Detail.errorCode);
                }
                else
                {
                    Logger.PrintRezult(false, "Некорректный код ошибки " + exception.Detail.errorDescription + " " + exception.Detail.errorCode);
                }
            }
            catch (Exception ex)
            {
                Logger.PrintRezult(false, ex.Message);
                globalR = false;
            }
        }
Example #2
0
        public void step_04_s()
        {
            Logger.PrintStepName("Step 4");
            SubscriberService.SubscriberInterface    si         = new SubscriberInterfaceClient();
            SubscriberService.getServicesListRequest getRequest = new getServicesListRequest();
            getRequest.token = token;
            getRequest.ban   = ban;
            getRequest.ctn   = ctn_x;
            getRequest.hash  = ths.GetHashAPI(ban + ctn_x);
            try
            {
                Logger.PrintAction("Получение списка услуг", "");
                SubscriberService.getServicesListResponse requestResponse = si.getServicesList(getRequest);
                var s = requestResponse.servicesList;

                if (s[0] != null)
                {
                    Logger.PrintRezult(false, "Метод отрабатывает");
                    globalR = false;
                }
            }
            catch (FaultException <UssWsApiException> exception)
            {
                if (exception.Detail.errorCode == 20005 && exception.Detail.errorDescription == "CTN_NOT_FOUND")
                {
                    Logger.PrintRezult(true, "Код ошибки корректный " + exception.Detail.errorDescription + " " + exception.Detail.errorCode);
                }
                else
                {
                    Logger.PrintRezult(false, "Некорректный код ошибки " + exception.Detail.errorDescription + " " + exception.Detail.errorCode);
                }
            }
            catch (Exception ex)
            {
                Logger.PrintRezult(false, ex.Message);
                globalR = false;
            }
        }
Example #3
0
        public void step_07()
        {
            SubscriberService.SubscriberInterface    si         = new SubscriberInterfaceClient();
            SubscriberService.getServicesListRequest getRequest = new getServicesListRequest();
            getRequest.token = token + "AA";
            getRequest.ban   = ban;
            getRequest.ctn   = ctn;
            try
            {
                Logger.PrintAction("Получение списка услуг", "Несуществующий токен");
                SubscriberService.getServicesListResponse requestResponse = si.getServicesList(getRequest);
                var s = requestResponse.servicesList;

                if (s[0] != null)
                {
                    Logger.PrintRezult(false, "Метод отрабатывает");
                    globalR = false;
                }
            }
            catch (FaultException <UssWsApiException> exception)
            {
                if (exception.Detail.errorCode == 20003 && exception.Detail.errorDescription == "TOKEN_NOT_FOUND")
                {
                    Logger.PrintRezult(true, "Код ошибки корректный " + exception.Detail.errorDescription + " " + exception.Detail.errorCode);
                }
                else
                {
                    Logger.PrintRezult(false, "Некорректный код ошибки " + exception.Detail.errorDescription + " " + exception.Detail.errorCode);
                }
            }
            catch (Exception ex)
            {
                Logger.PrintRezult(false, ex.Message);
                globalR = false;
            }
        }
Example #4
0
 public void step_03_s()
 {
     Logger.PrintStepName("Step 3");
     SubscriberService.SubscriberInterface    si         = new SubscriberInterfaceClient();
     SubscriberService.getServicesListRequest getRequest = new getServicesListRequest();
     getRequest.token = token;
     getRequest.ban   = ban;
     getRequest.hash  = ths.GetHashAPI(ban);
     try
     {
         Logger.PrintAction("Получение списка услуг", "");
         SubscriberService.getServicesListResponse requestResponse = si.getServicesList(getRequest);
         var s = requestResponse.servicesList;
         Logger.PrintAction("Список услуг получен", "");
         var query = Executor.ExecuteSelect("select subscriber_no, soc, effective_date, expiration_date from ecr9_service_agreement where ban = '" + ban + "' and service_type <> 'P'");
         int row = 0, reqCount = 0, rowmax = query.Count, reqCountmax = s.Count();
         //string subscriber_no, soc, effective_date, expiration_date;
         while (reqCount < reqCountmax)
         {
             while (row < rowmax)
             {
                 if (s[reqCount].serviceId == query[row, 1].Replace(" ", ""))
                 {
                     var  soc       = query[row, 1].Replace(" ", "");
                     bool soc_name  = false;
                     var  soc_name1 = Executor.ExecuteSelect("select entity_name from web_entity where ext_entity_code like '" + soc + "%'");
                     var  soc_name2 = Executor.ExecuteSelect("select price_plan_description from price_plan where external_price_plan like '" + soc + "%'");
                     var  soc_name3 = Executor.ExecuteSelect("select soc_description from soc@" + db_Ans + " where soc like '" + soc + "%'");
                     if (soc_name1.Count != 0)
                     {
                         if (soc_name1[0, 0].Contains(s[reqCount].serviceName))
                         {
                             soc_name = true;
                         }
                     }
                     if (soc_name2.Count != 0)
                     {
                         if (soc_name2[0, 0].Contains(s[reqCount].serviceName))
                         {
                             soc_name = true;
                         }
                     }
                     if (soc_name3.Count != 0)
                     {
                         if (soc_name3[0, 0].Contains(s[reqCount].serviceName))
                         {
                             soc_name = true;
                         }
                     }
                     if (soc_name == false)
                     {
                         Logger.PrintRezult(false, "С тарифами всё плохо");
                         globalR = false;
                     }
                     if (!query[row, 0].Contains(s[reqCount].ctn))
                     {
                         Logger.PrintRezult(false, "Не совпадает ctn");
                         globalR = false;
                     }
                     if (s[reqCount].serviceId != soc)
                     {
                         Logger.PrintRezult(false, "Не совпадает soc");
                         globalR = false;
                     }
                     if (s[reqCount].startDate.Date.ToString() != query[row, 2])
                     {
                         Logger.PrintRezult(false, "Не совпадает дата");
                         globalR = false;
                     }
                     row = 100500;
                 }
                 row++;
             }
             reqCount++;
             row = 0;
         }
         Logger.PrintRezult(true, "Список услуг получен корректно");
     }
     catch (Exception ex)
     {
         Logger.PrintRezult(false, "Ошибка при получении списка услуг " + ex.Message);
     }
 }
Example #5
0
        public void step_05()
        {
            Logger.PrintStepName("Step 5");
            SubscriberService.SubscriberInterface    si         = new SubscriberInterfaceClient();
            SubscriberService.getServicesListRequest getRequest = new getServicesListRequest();
            //getRequest.token = token;
            getRequest.ban = ban;
            getRequest.ctn = ctn;
            try
            {
                Logger.PrintAction("Получение списка услуг", "Не введен токен");
                SubscriberService.getServicesListResponse requestResponse = si.getServicesList(getRequest);
                var s = requestResponse.servicesList;

                if (s[0] != null)
                {
                    Logger.PrintRezult(false, "Метод отрабатывает");
                    globalR = false;
                }
            }
            catch (FaultException <UssWsApiException> exception)
            {
                if (exception.Detail.errorCode == 20001 && exception.Detail.errorDescription == "INVALID_QUERY_PARAM")
                {
                    Logger.PrintRezult(true, "Код ошибки корректный " + exception.Detail.errorDescription + " " + exception.Detail.errorCode);
                }
                else
                {
                    Logger.PrintRezult(false, "Некорректный код ошибки " + exception.Detail.errorDescription + " " + exception.Detail.errorCode);
                }
            }
            catch (Exception ex)
            {
                Logger.PrintRezult(false, ex.Message);
                globalR = false;
            }

            getRequest.token = token;
            getRequest.ban   = null;
            getRequest.ctn   = ctn;
            try
            {
                Logger.PrintAction("Получение списка услуг", "Не введен ban");
                SubscriberService.getServicesListResponse requestResponse = si.getServicesList(getRequest);
                var s = requestResponse.servicesList;

                if (s[0] != null)
                {
                    Logger.PrintRezult(false, "Метод отрабатывает");
                    globalR = false;
                }
            }
            catch (FaultException <UssWsApiException> exception)
            {
                if (exception.Detail.errorCode == 20001 && exception.Detail.errorDescription == "INVALID_QUERY_PARAM")
                {
                    Logger.PrintRezult(true, "Код ошибки корректный " + exception.Detail.errorDescription + " " + exception.Detail.errorCode);
                }
                else
                {
                    Logger.PrintRezult(false, "Некорректный код ошибки " + exception.Detail.errorDescription + " " + exception.Detail.errorCode);
                }
            }
            catch (Exception ex)
            {
                Logger.PrintRezult(false, ex.Message);
                globalR = false;
            }
        }