public void GetLonMinutes_West_Pass() { var LTH = new LookupTablesHelper(); decimal startingLon = -122.0m; int lonDir = -1; string grid = "CN87ut"; decimal actualAdjLonDegrees; decimal actualResult; decimal expectedAdjLatDegrees = -122.0m; decimal expectedLonMinutes = 17.5m; if (LTH.GenerateTableLookups()) { actualResult = ConversionHelper.GetLonMinutes(LTH, startingLon, lonDir, grid, out actualAdjLonDegrees); } else { actualAdjLonDegrees = 0m; actualResult = 0m; } Assert.AreEqual(expectedLonMinutes, actualResult); Assert.AreEqual(expectedAdjLatDegrees, actualAdjLonDegrees); }
public void GetLatMinutes_North_Pass() { var LTH = new LookupTablesHelper(); decimal startingLat = 47.0m; int latDir = 1; string grid = "CN87ut"; decimal actualAdjLatDegrees; decimal actualLatMinutesResult; decimal expectedAdjLatDegrees = 47.0m; decimal expectedResult = 48.75m; if (LTH.GenerateTableLookups()) { actualLatMinutesResult = ConversionHelper.GetLatMinutes(LTH, startingLat, latDir, grid, out actualAdjLatDegrees); } else { actualAdjLatDegrees = 0m; actualLatMinutesResult = 0m; } Assert.AreEqual(expectedResult, actualLatMinutesResult); Assert.AreEqual(expectedAdjLatDegrees, actualAdjLatDegrees); }
public void Test_GenerateTableLookups() { bool expectedResult = true; var lth = new LookupTablesHelper(); bool actualResult = lth.GenerateTableLookups(); Assert.IsTrue(expectedResult == actualResult); }
public void GetLatDegrees_South_Pass() { var LTH = new LookupTablesHelper(); decimal actualResult; short actualLatDirection; decimal expectedResult = -120; short expectedLatDirection = -1; if (LTH.GenerateTableLookups()) { string grid = "CN87ut"; actualResult = ConversionHelper.GetLonDegrees(LTH, grid, out actualLatDirection); } else { actualResult = 0; actualLatDirection = 0; } Assert.AreEqual(expectedResult, actualResult); Assert.AreEqual(expectedLatDirection, actualLatDirection); }