示例#1
0
        public void step_02()
        {
            Logger.PrintStepName("Step 2");
            SubscriberService.SubscriberInterface   si         = new SubscriberInterfaceClient();
            SubscriberService.getCTNInfoListRequest getRequest = new getCTNInfoListRequest();
            getRequest.ctn   = ctn;
            getRequest.token = token;
            getRequest.ban   = ban;

            try
            {
                Logger.PrintAction("Получение информации о ctn", "");
                SubscriberService.getCTNInfoListResponse requestResponse = si.getCTNInfoList(getRequest);
                var s = requestResponse.CTNInfoList;

                Logger.PrintAction("Информация о ctn получена", "");

                var    query = Executor.ExecuteSelect("SELECT SUBSCRIBER_NO AS CTN, SUB_STATUS_DATE AS statusDate, SUB_STATUS AS status, CURRENT_PP AS prШcePAL, SUB_STATUS_RSN_CODE AS reasonStatus from ecr9_subscriber WHERE SUBSCRIBER_NO = '" + ctn + "'");
                string qctn  = s[0].ctn.Remove(0, 1);
                if (query[0, 0].Replace(" ", "") != qctn)
                {
                    Logger.PrintRezult(false, "Не совпадает номер стн");
                    globalR = false;
                }
                string qStatusDate = Convert.ToString(s[0].statusDate);
                if (query[0, 1] != qStatusDate)
                {
                    Logger.PrintRezult(false, "Не совпадает дата");
                    globalR = false;
                }
                string qStatus = Convert.ToString(s[0].status[0]);
                if (query[0, 2] != qStatus)
                {
                    Logger.PrintRezult(false, "Не совпадает status");
                    globalR = false;
                }
                string qPricePlan = s[0].pricePlan.Replace(" ", "");
                if (query[0, 3].Replace(" ", "") != qPricePlan)
                {
                    Logger.PrintRezult(false, "Не совпадает priceplan");
                    globalR = false;
                }
                if (query[0, 4].Replace(" ", "") != s[0].reasonStatus)
                {
                    Logger.PrintRezult(false, "Не совпадает reasonstatus");
                    globalR = false;
                }
                Logger.PrintRezult(true, "Данные корректны");
            }
            catch (FaultException <UssWsApiException> exception)
            {
                Logger.PrintRezult(false, exception.Detail.errorDescription + " " + exception.Detail.errorCode);
                globalR = false;
            }
            catch (Exception ex)
            {
                Logger.PrintRezult(false, ex.Message);
                globalR = false;
            }
        }
示例#2
0
        public void step_08()
        {
            SubscriberService.SubscriberInterface   si         = new SubscriberInterfaceClient();
            SubscriberService.getCTNInfoListRequest getRequest = new getCTNInfoListRequest();
            ban = ReaderTestData.ReadExel(testName, "BAN105");
            ctn = ReaderTestData.ReadExel(testName, "ctn105");
            getRequest.token = token;
            getRequest.ban   = ban;
            getRequest.ctn   = ctn;
            try
            {
                Logger.PrintAction("Получение информации о ctn", "Не аутентифицированный");
                SubscriberService.getCTNInfoListResponse requestResponse = si.getCTNInfoList(getRequest);
                var s = requestResponse.CTNInfoList;

                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;
            }
        }
示例#3
0
        public void step_04_s()
        {
            Logger.PrintStepName("Step 4");
            SubscriberService.SubscriberInterface   si         = new SubscriberInterfaceClient();
            SubscriberService.getCTNInfoListRequest getRequest = new getCTNInfoListRequest();
            getRequest.token = token;
            getRequest.ban   = ban;
            getRequest.ctn   = ctn_x;
            getRequest.hash  = ths.GetHashAPI(ban + ctn_x);
            try
            {
                Logger.PrintAction("Получение информации о ctn", "");
                SubscriberService.getCTNInfoListResponse requestResponse = si.getCTNInfoList(getRequest);
                var s = requestResponse.CTNInfoList;

                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;
            }
        }
示例#4
0
        public void step_05()
        {
            Logger.PrintStepName("Step 5");
            SubscriberService.SubscriberInterface   si         = new SubscriberInterfaceClient();
            SubscriberService.getCTNInfoListRequest getRequest = new getCTNInfoListRequest();
            //getRequest.token = token;
            getRequest.ban = ban;
            getRequest.ctn = ctn;
            try
            {
                Logger.PrintAction("Получение информации о ctn", "Не введен токен");
                SubscriberService.getCTNInfoListResponse requestResponse = si.getCTNInfoList(getRequest);
                var s = requestResponse.CTNInfoList;

                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("Получение информации о ctn", "Не введен ban");
                SubscriberService.getCTNInfoListResponse requestResponse = si.getCTNInfoList(getRequest);
                var s = requestResponse.CTNInfoList;

                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;
            }
        }