public static CommandAckDTO createCommandAckDTO(CommandAck source) { if (null == source) { return(null); } CommandAckDTO result = new CommandAckDTO(); result.command = source.command.ToString(); result.result = source.result.ToString(); return(result); }
public void CheckCommandAck() { MAVLink.mavlink_command_ack_t data = new MAVLink.mavlink_command_ack_t(); data.command = 16; data.result = 0; MavLinkMessage message = createSampleMessage(MAVLink.MAVLINK_MSG_ID.COMMAND_ACK, data); CommandAck obj = new CommandAck(message); Assert.AreEqual(obj.command, MAVLink.MAV_CMD.WAYPOINT); Assert.AreEqual(obj.result, MAVLink.MAV_RESULT.ACCEPTED); CommandAckDTO dto = DTOFactory.createCommandAckDTO(obj); Assert.AreEqual(dto.command, MAVLink.MAV_CMD.WAYPOINT.ToString()); Assert.AreEqual(dto.result, MAVLink.MAV_RESULT.ACCEPTED.ToString()); }