Esempio n. 1
0
        public void testPushRki2GroupValidateFail()
        {
            CreateTerminalGroupRkiTaskRequest request = new CreateTerminalGroupRkiTaskRequest();
            Result <TerminalGroupRkiTask>     result  = API.PushRkiKey2Group(request);

            _logger.DebugFormat("Result=\n{0}", JsonConvert.SerializeObject(result));
            Assert.AreEqual(result.BusinessCode, -1);
        }
Esempio n. 2
0
        public void testPushRki2Group()
        {
            CreateTerminalGroupRkiTaskRequest request = new CreateTerminalGroupRkiTaskRequest();

            request.GroupId = 1001218169;
            request.RkiKey  = "TEMPLATE_BDK_11";
            Result <TerminalGroupRkiTask> result = API.PushRkiKey2Group(request);

            _logger.DebugFormat("Result=\n{0}", JsonConvert.SerializeObject(result));
            Assert.AreEqual(result.BusinessCode, 0);
        }
Esempio n. 3
0
        public Result <TerminalGroupRkiTask> PushRkiKey2Group(CreateTerminalGroupRkiTaskRequest createTerminalGroupRkiTaskRequest)
        {
            List <string> validationErrs = ValidateCreate(createTerminalGroupRkiTaskRequest, new CreateTerminalGroupRkiTaskValidator(), "parameterCreateTerminalGroupRkiTaskRequestIsNull");

            if (validationErrs.Count > 0)
            {
                return(new Result <TerminalGroupRkiTask>(validationErrs));
            }
            RestRequest request     = new RestRequest(CREATE_TERMINAL_GROUP_RKI_URL, Method.POST);
            var         requestJson = JsonConvert.SerializeObject(createTerminalGroupRkiTaskRequest);

            request.AddParameter(Constants.CONTENT_TYPE_JSON, requestJson, ParameterType.RequestBody);
            var responseContent = Execute(request);
            TerminalGroupRkiTaskResponse  response = JsonConvert.DeserializeObject <TerminalGroupRkiTaskResponse>(responseContent);
            Result <TerminalGroupRkiTask> result   = new Result <TerminalGroupRkiTask>(response);

            return(result);
        }