public void TestInterpolateWithPointHit() { var target = new IdwInterpolator(dimensions: 2, power: 2, numberOfNeighbours: 4); target.AddPointRange(_pointRange); // Test adding point range. var result = target.Interpolate(1, 1); Assert.Equal(2.2, result.Value); Assert.Equal(1, result.Point.Value.Coordinates[0]); Assert.Equal(1, result.Point.Value.Coordinates[1]); Assert.Equal(InterpolationResult.ResultOptions.Hit, result.Result); }
public void FailWithPointRangeWithWrongDimension() { var target = new IdwInterpolator(dimensions: 2, power: 2, numberOfNeighbours: 5); var pointRange = new List <Point> { new Point(1.0, 0, 0), new Point(1.1, 0, 1), new Point(1.2, 0, 2), new Point(2.0, 1, 0), new Point(2.2, 1, 1), new Point(2.4, 1) // Dimension wrong. }; target.AddPointRange(pointRange); }
public void FailWithNullPointRange() { var target = new IdwInterpolator(dimensions: 2, power: 2, numberOfNeighbours: 5); target.AddPointRange(null); }
public void FailWithNullPointRange() { var target = new IdwInterpolator(dimensions: 2, power: 2, numberOfNeighbours: 5); Assert.Throws <ArgumentNullException>(() => target.AddPointRange(null)); }