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); }
public void ConvertPosition_Throws_WithNonNumericValues() { var inputString = "a|b|c"; Assert.ThrowsException <ArgumentException>(() => DroneTelemetryConverter.ConvertPosition(inputString)); }
public void ConvertPosition_Throws_WithMissingValue() { var inputString = "47.757084||-121.989734"; Assert.ThrowsException <ArgumentException>(() => DroneTelemetryConverter.ConvertPosition(inputString)); }
public void ConvertPosition_Throws_WithInvalidLatitude() { var inputString = "+47.757084|-190|93.98"; Assert.ThrowsException <ArgumentException>(() => DroneTelemetryConverter.ConvertPosition(inputString)); }
public void ConvertPosition_Throws_WithInvalidLongitude() { var inputString = "+95|-121.989734|93.98"; Assert.ThrowsException <ArgumentException>(() => DroneTelemetryConverter.ConvertPosition(inputString)); }