示例#1
0
        public OutParamModel Order(InParamModel inParam)
        {
            RequestModel request = new RequestModel();

            request.Role      = inParam.Role;
            request.Operation = inParam.Operation;
            request.Domain    = inParam.Domain;
            request.Address   = inParam.Address;


            ResponseModel response = this.CommunicationWithServer(request);
            OutParamModel outParam = new OutParamModel()
            {
                Raw = ""
            };

            if (response != null)
            {
                outParam.Raw    += (response.Status == StatusType.Success) ? "succeed " : "failed ";
                outParam.Records = response.Records;
                foreach (RecordModel record in response.Records)
                {
                    outParam.Raw += "[";
                    outParam.Raw += record.Domain + " ";
                    outParam.Raw += record.Address + " ";
                    outParam.Raw += record.Date;
                    outParam.Raw += "]";
                }
            }
            return(outParam);
        }
示例#2
0
        public void TestToModel(string cmd)
        {
            CmdSerializer <InParamModel> inParam = new CmdSerializer <InParamModel>(cmd.Split(' '));
            InParamModel inParamModel            = inParam.ToModel();

            Assert.IsTrue(inParamModel != null);
        }
示例#3
0
        public void TestOrder(string args)
        {
            TestServer server = new TestServer(base.RemoteTestEndpoint);
            CmdSerializer <InParamModel> cmdHelper = new CmdSerializer <InParamModel>(args.Split(' '));
            InParamModel inParam = cmdHelper.AddMatchedGroups().ToModel();

            server.Work();
            while (!server.IsWork)
            {
                ;
            }
            OutParamModel outParam = this._client.Order(inParam);

            Assert.IsTrue(outParam.Raw.IndexOf(inParam.Domain) > 0 && outParam.Raw.IndexOf(inParam.Address) > 0 && outParam.Raw.IndexOf("0000-00-00(00:00:00:00)") > 0);
        }