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

            try
            {
                Logger.PrintAction("Получение unbilled", "");
                SubscriberService.getUnbilledCallsListResponse requestResponse = si.getUnbilledCallsList(getRequest);
                var s = requestResponse.UnbilledCallsList;
                if (s != null)
                {
                    Logger.PrintRezult(true, "Список получен " + s[0].callDate);
                }
                else
                {
                    Logger.PrintRezult(false, "Список не получен");
                }
            }
            catch (Exception ex)
            {
                Assertion("Ошибка при подключении услуги: " + ex.Message, Assert.Fail);
            }
        }
Example #2
0
        public void step_04()
        {
            Logger.PrintStepName("Step 4");
            SubscriberService.SubscriberInterface         si         = new SubscriberInterfaceClient();
            SubscriberService.getUnbilledCallsListRequest getRequest = new getUnbilledCallsListRequest();

            getRequest.token = token;
            getRequest.ctn   = ctn + 123;
            try
            {
                Logger.PrintAction("Получение unbilled", "несуществующий ctn ");
                SubscriberService.getUnbilledCallsListResponse requestResponse = si.getUnbilledCallsList(getRequest);
                var s = requestResponse.UnbilledCallsList;
                if (s != null)
                {
                    Logger.PrintRezult(false, "Список получен " + s[0].callDate);
                }
                else
                {
                    Logger.PrintRezult(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)
            {
                Assertion("Ошибка при подключении услуги: " + ex.Message, Assert.Fail);
            }
        }
Example #3
0
        public void step_s_03()
        {
            Logger.PrintStepName("Step 3");
            SubscriberService.SubscriberInterface         si         = new SubscriberInterfaceClient();
            SubscriberService.getUnbilledCallsListRequest getRequest = new getUnbilledCallsListRequest();

            getRequest.token = token;
            getRequest.hash  = ths.GetHashAPI("");
            try
            {
                Logger.PrintAction("Получение unbilled", "без ctn ");
                SubscriberService.getUnbilledCallsListResponse requestResponse = si.getUnbilledCallsList(getRequest);
                var s = requestResponse.UnbilledCallsList;
                if (s != null)
                {
                    Logger.PrintRezult(false, "Список получен " + s[0].callDate);
                }
                else
                {
                    Logger.PrintRezult(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)
            {
                Assertion("Ошибка при подключении услуги: " + ex.Message, Assert.Fail);
            }
            getRequest.ctn   = ctn;
            getRequest.token = null;
            getRequest.hash  = ths.GetHashAPI(ctn);
            try
            {
                Logger.PrintAction("Получение unbilled", "без токена");
                SubscriberService.getUnbilledCallsListResponse requestResponse = si.getUnbilledCallsList(getRequest);
                var s = requestResponse.UnbilledCallsList;
                if (s != null)
                {
                    Logger.PrintRezult(false, "Список получен " + s[0].callDate);
                }
                else
                {
                    Logger.PrintRezult(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)
            {
                Assertion("Ошибка при подключении услуги: " + ex.Message, Assert.Fail);
            }
        }