public void CheckVfrHudObject() { MAVLink.mavlink_vfr_hud_t data = new MAVLink.mavlink_vfr_hud_t(); data.airspeed = 1; data.alt = 2; data.climb = 3; data.groundspeed = 4; data.heading = 5; data.throttle = 6; MavLinkMessage message = createSampleMessage(MAVLink.MAVLINK_MSG_ID.VFR_HUD, data); VfrHud obj = new VfrHud(message); Assert.AreEqual(data.airspeed, obj.airspeed); Assert.AreEqual(data.alt, obj.alt); Assert.AreEqual(data.climb, obj.climb); Assert.AreEqual(data.groundspeed, obj.groundspeed); Assert.AreEqual(data.heading, obj.heading); Assert.AreEqual(data.throttle, obj.throttle); VfrHudDTO dto = DTOFactory.createVfrHudDTO(obj); Assert.AreEqual(dto.airspeed, obj.airspeed); Assert.AreEqual(dto.alt, obj.alt); Assert.AreEqual(dto.climb, obj.climb); Assert.AreEqual(dto.groundspeed, obj.groundspeed); Assert.AreEqual(dto.heading, obj.heading); Assert.AreEqual(dto.throttle, obj.throttle); }
public static VfrHudDTO createVfrHudDTO(VfrHud source) { if (null == source) { return(null); } VfrHudDTO result = new VfrHudDTO(); Utilities.CopySimilar.CopyAll(source, result); return(result); }