public void TestFromInvalidRadianLatitude() { var radianLongitude = GenerateValidValue(GeographicalLocation.MAX_RADIAN_LONGITUDE); var radianLatitude = GenerateInvalidValue(GeographicalLocation.MAX_RADIAN_LATITUDE); var location = GeographicalLocation.FromRadians(radianLongitude, radianLatitude); }
public void TestFromValidRadians() { const int runs = 10; for (int i = 0; i < runs; ++i) { var radianLongitude = GenerateValidValue(GeographicalLocation.MAX_RADIAN_LONGITUDE); var radianLatitude = GenerateValidValue(GeographicalLocation.MAX_RADIAN_LATITUDE); var degreeLongitude = Calculator.DegreesToRadians(radianLongitude); var degreeLatitude = Calculator.DegreesToRadians(radianLatitude); var location = GeographicalLocation.FromRadians(radianLongitude, radianLatitude); Assert.IsTrue(location.RadianLongitude == radianLongitude, String.Format("Location radian longitude is not equal to the expected radian longitude! Expected: {0}, got: {1}.", radianLongitude, location.RadianLongitude)); Assert.IsTrue(location.RadianLatitude == radianLatitude, String.Format("Location radian latitude is not equal to the expected radian latitude! Expected: {0}, got: {1}.", radianLatitude, location.RadianLatitude)); Assert.IsTrue(location.RadianLongitude == radianLongitude, String.Format("Location radian longitude is not equal to the expected radian longitude! Expected: {0}, got: {1}.", radianLongitude, location.RadianLongitude)); Assert.IsTrue(location.RadianLatitude == radianLatitude, String.Format("Location radian latitude is not equal to the expected radian latitude! Expected: {0}, got: {1}.", radianLatitude, location.RadianLatitude)); } }