public virtual void TestCloneStuffPolyline() { com.esri.core.geometry.Polyline poly = new com.esri.core.geometry.Polyline(); poly.StartPath(10, 1); poly.LineTo(15, 20); poly.LineTo(30, 14); poly.LineTo(60, 144); poly.StartPath(10, 1); poly.LineTo(15, 20); poly.LineTo(300, 14); poly.LineTo(60, 144); poly.StartPath(10, 1); poly.LineTo(125, 20); poly.LineTo(30, 14); poly.LineTo(600, 144); poly.ClosePathWithLine(); com.esri.core.geometry.Polyline clone = (com.esri.core.geometry.Polyline)poly.Copy(); NUnit.Framework.Assert.IsTrue(clone.GetPathCount() == 3); NUnit.Framework.Assert.IsTrue(clone.GetPathStart(2) == 8); NUnit.Framework.Assert.IsTrue(!clone.IsClosedPath(0)); NUnit.Framework.Assert.IsTrue(!clone.IsClosedPath(1)); NUnit.Framework.Assert.IsTrue(clone.IsClosedPath(2)); NUnit.Framework.Assert.IsTrue(clone.GetXY(5).IsEqual(new com.esri.core.geometry.Point2D(15, 20))); }
public virtual void TestGeometryCopy() { bool noException = true; com.esri.core.geometry.Polyline polyline = new com.esri.core.geometry.Polyline(); com.esri.core.geometry.Point p1 = new com.esri.core.geometry.Point(-85.59285621496956, 38.26004727491098); com.esri.core.geometry.Point p2 = new com.esri.core.geometry.Point(-85.56417866635002, 38.28084064314639); com.esri.core.geometry.Point p3 = new com.esri.core.geometry.Point(-85.56845156650877, 38.24659881865461); com.esri.core.geometry.Point p4 = new com.esri.core.geometry.Point(-85.55341069949853, 38.26671513050464); polyline.StartPath(p1); try { polyline.LineTo(p2); polyline.Copy(); polyline.LineTo(p3); polyline.Copy(); polyline.LineTo(p4); } catch (System.Exception e) { // exception thrown here!!! // e.PrintStackTrace(); noException = false; } NUnit.Framework.Assert.IsTrue(noException); }