public void CheckTerrainReportObject()
        {
            MAVLink.mavlink_terrain_report_t data = new MAVLink.mavlink_terrain_report_t();
            data.current_height = 1;
            data.lat            = 2;
            data.loaded         = 3;
            data.lon            = 4;
            data.pending        = 5;
            data.spacing        = 6;
            data.terrain_height = 7;

            MavLinkMessage message = createSampleMessage(MAVLink.MAVLINK_MSG_ID.TERRAIN_REPORT, data);

            TerrainReport obj = new TerrainReport(message);

            Assert.AreEqual(data.current_height, obj.current_height);
            Assert.AreEqual(data.lat, obj.lat);
            Assert.AreEqual(data.loaded, obj.loaded);
            Assert.AreEqual(data.lon, obj.lon);
            Assert.AreEqual(data.pending, obj.pending);
            Assert.AreEqual(data.spacing, obj.spacing);
            Assert.AreEqual(data.terrain_height, obj.terrain_height);

            TerrainReportDTO dto = DTOFactory.createTerrainReportDTO(obj);

            Assert.AreEqual(dto.current_height, obj.current_height);
            Assert.AreEqual(dto.lat, obj.lat);
            Assert.AreEqual(dto.loaded, obj.loaded);
            Assert.AreEqual(dto.lon, obj.lon);
            Assert.AreEqual(dto.pending, obj.pending);
            Assert.AreEqual(dto.spacing, obj.spacing);
            Assert.AreEqual(dto.terrain_height, obj.terrain_height);
        }
Exemple #2
0
        public static TerrainReportDTO createTerrainReportDTO(TerrainReport source)
        {
            if (null == source)
            {
                return(null);
            }
            TerrainReportDTO result = new TerrainReportDTO();

            Utilities.CopySimilar.CopyAll(source, result);
            return(result);
        }