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); }
public void TestToModel(string cmd) { CmdSerializer <InParamModel> inParam = new CmdSerializer <InParamModel>(cmd.Split(' ')); InParamModel inParamModel = inParam.ToModel(); Assert.IsTrue(inParamModel != null); }
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); }