示例#1
0
        /// <summary>
        /// Caches (new or updated) live waypoint data
        /// </summary>
        /// <param name="data">live waypoint data to cache</param>
        public void CacheLiveWaypointData(LiveWaypointData data)
        {
            this.logger.LogDebug($"caching live waypoint data for id: {data.ID}");

            lock (this.lockCacheAndQueue)
            {
                this.liveWaypointCache[data.ID] = data;
            }
        }
示例#2
0
        public void TestLiveWaypointData()
        {
            // run
            string filename = Path.Combine(this.TestAssetsPath, "GarminInreachRawKmlData.kml");

            LiveWaypointData data = null;

            using (var stream = new FileStream(filename, FileMode.Open))
            {
                var dataService = new GarminInreachDataService();

                data = dataService.ParseRawKmlDataFile(stream, "test123");
            }

            // check
            Assert.IsNotNull(data, "returned data must not be null");
            Assert.IsTrue(data.ID.Length > 0, "ID must be non-empty");
            Assert.IsTrue(data.Name.Length > 0, "name must be non-empty");
            Assert.IsTrue(data.Description.Length > 0, "description must be non-empty");
        }