Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public void ConvertPosition_Throws_WithNonNumericValues()
        {
            var inputString = "a|b|c";

            Assert.ThrowsException <ArgumentException>(() => DroneTelemetryConverter.ConvertPosition(inputString));
        }
Ejemplo n.º 3
0
        public void ConvertPosition_Throws_WithMissingValue()
        {
            var inputString = "47.757084||-121.989734";

            Assert.ThrowsException <ArgumentException>(() => DroneTelemetryConverter.ConvertPosition(inputString));
        }
Ejemplo n.º 4
0
        public void ConvertPosition_Throws_WithInvalidLatitude()
        {
            var inputString = "+47.757084|-190|93.98";

            Assert.ThrowsException <ArgumentException>(() => DroneTelemetryConverter.ConvertPosition(inputString));
        }
Ejemplo n.º 5
0
        public void ConvertPosition_Throws_WithInvalidLongitude()
        {
            var inputString = "+95|-121.989734|93.98";

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