public void SerializeSolveRequest() { SolveRequest d = new SolveRequest(); string xml = d.SerializeToXML(); Assert.IsNotNull(xml); }
private void SendSolveRequest(SolveRequest solveRequest) { String message = solveRequest.SerializeToXML(); CMSocket.Instance.SendMessage(this.Port, this.IP, message, this); //nowy comment //Object obj = response.DeserializeXML(); //Debug.Assert(obj is SolveRequestResponse, "Wrong response object"); //SolveRequestResponse requestResopnse = (SolveRequestResponse)obj; //Debug.Assert(requestResopnse.IdSpecified, "No ID in solve request response"); //if (!requestResopnse.IdSpecified) // return; //Console.WriteLine("ID of the problem" + requestResopnse.Id); //stary comment //string message = solveRequest.SerializeToXML(); //string res = CMSocket.Instance.SendMessage(this.Port, this.IP, message, this); //Object obj = res.DeserializeXML(); //if (!(obj is SolveRequestResponse)) // throw new Exception("Wrong type"); //SolveRequestResponse response = (SolveRequestResponse)obj; //if (response.IdSpecified) { // ulong id = response.Id; //} }
public void DeserializeSolveRequest() { SolveRequest d = new SolveRequest(); string xml = d.SerializeToXML(); d = (SolveRequest)xml.DeserializeXML(); Assert.IsNotNull(d); }