public void GetColorNaNTest() { IProjectionGridMap projectionGridMap = new MockClasses.MockProjectionGridMap(); ImageColorMap target = new ImageColorMap(projectionGridMap); Color actual = target.GetColor(double.NaN, double.NaN); Assert.AreEqual(Color.Transparent, actual); }
public void GetColorTest() { IProjectionGridMap projectionGridMap = new MockClasses.MockProjectionGridMap(); ImageColorMap target = new ImageColorMap(projectionGridMap); double longitude = 200; double latitude = 400; Color expected = Color.FromArgb(0, 0, 2, 88); Color actual = target.GetColor(longitude, latitude); Assert.AreEqual(expected, actual); }
public void GetColorTest() { string colorMapFile = Path.Combine(TestDataPath, "ColorMap.png"); IProjectionGridMap projectionGridMap = new MockClasses.MockProjectionGridMap(); ColorMapOrientation orientation = ColorMapOrientation.Vertical; double minimumValue = double.MinValue; double maximumValue = double.MaxValue; DataColorMap target = new DataColorMap(colorMapFile, projectionGridMap, orientation, minimumValue, maximumValue); Color expectedColor = Color.FromArgb(255, 164, 169, 230); Color actual = target.GetColor(200, 400); Assert.AreEqual(expectedColor, actual); }
public void GetNaNColorTest() { try { string colorMapFile = Path.Combine(TestDataPath, "ColorMap.png"); IProjectionGridMap projectionGridMap = new MockClasses.MockProjectionGridMap(); ColorMapOrientation orientation = ColorMapOrientation.Vertical; double minimumValue = double.MinValue; double maximumValue = double.MaxValue; DataColorMap target = new DataColorMap(colorMapFile, projectionGridMap, orientation, minimumValue, maximumValue); Color color = target.GetColor(double.NaN, double.NaN); Assert.AreEqual(color, Color.Transparent); } catch (Exception ex) { Assert.Fail(ex.Message); } }