Пример #1
0
        public void ConvertPosition_Converts()
        {
            var inputString = "+47.757084|-121.989734|93.98";
            var result      = DroneTelemetryConverter.ConvertPosition(inputString);

            Assert.AreEqual(47.757084, result.Latitude);
            Assert.AreEqual(-121.989734, result.Longitude);
        }
Пример #2
0
        public void ConvertPosition_Throws_WithNonNumericValues()
        {
            var inputString = "a|b|c";

            Assert.ThrowsException <ArgumentException>(() => DroneTelemetryConverter.ConvertPosition(inputString));
        }
Пример #3
0
        public void ConvertPosition_Throws_WithMissingValue()
        {
            var inputString = "47.757084||-121.989734";

            Assert.ThrowsException <ArgumentException>(() => DroneTelemetryConverter.ConvertPosition(inputString));
        }
Пример #4
0
        public void ConvertPosition_Throws_WithInvalidLatitude()
        {
            var inputString = "+47.757084|-190|93.98";

            Assert.ThrowsException <ArgumentException>(() => DroneTelemetryConverter.ConvertPosition(inputString));
        }
Пример #5
0
        public void ConvertPosition_Throws_WithInvalidLongitude()
        {
            var inputString = "+95|-121.989734|93.98";

            Assert.ThrowsException <ArgumentException>(() => DroneTelemetryConverter.ConvertPosition(inputString));
        }