Esempio n. 1
0
 public virtual void testPoint()
 {
     com.esri.core.geometry.Point pt = new com.esri.core.geometry.Point();
     pt.setXY(100, 200);
     NUnit.Framework.Assert.IsFalse(pt.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                    .M));
     pt.addAttribute(com.esri.core.geometry.VertexDescription.Semantics.M);
     NUnit.Framework.Assert.IsTrue(pt.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                   .M));
     NUnit.Framework.Assert.IsTrue(double.IsNaN(pt.getM()));
     pt.setAttribute(com.esri.core.geometry.VertexDescription.Semantics.M, 0, 13);
     NUnit.Framework.Assert.IsTrue(pt.getM() == 13);
     pt.addAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z);
     NUnit.Framework.Assert.IsTrue(pt.getZ() == 0);
     NUnit.Framework.Assert.IsTrue(pt.getM() == 13);
     pt.setAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 0, 11);
     NUnit.Framework.Assert.IsTrue(pt.getZ() == 11);
     NUnit.Framework.Assert.IsTrue(pt.getM() == 13);
     pt.addAttribute(com.esri.core.geometry.VertexDescription.Semantics.ID);
     NUnit.Framework.Assert.IsTrue(pt.getID() == 0);
     NUnit.Framework.Assert.IsTrue(pt.getZ() == 11);
     NUnit.Framework.Assert.IsTrue(pt.getM() == 13);
     pt.setAttribute(com.esri.core.geometry.VertexDescription.Semantics.ID, 0, 1);
     NUnit.Framework.Assert.IsTrue(pt.getID() == 1);
     NUnit.Framework.Assert.IsTrue(pt.getZ() == 11);
     NUnit.Framework.Assert.IsTrue(pt.getM() == 13);
     pt.dropAttribute(com.esri.core.geometry.VertexDescription.Semantics.M);
     NUnit.Framework.Assert.IsTrue(pt.getID() == 1);
     NUnit.Framework.Assert.IsTrue(pt.getZ() == 11);
     NUnit.Framework.Assert.IsFalse(pt.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                    .M));
     com.esri.core.geometry.Point pt1 = new com.esri.core.geometry.Point();
     NUnit.Framework.Assert.IsFalse(pt1.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                     .M));
     NUnit.Framework.Assert.IsFalse(pt1.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                     .Z));
     NUnit.Framework.Assert.IsFalse(pt1.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                     .ID));
     pt1.mergeVertexDescription(pt.getDescription());
     NUnit.Framework.Assert.IsFalse(pt1.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                     .M));
     NUnit.Framework.Assert.IsTrue(pt1.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                    .Z));
     NUnit.Framework.Assert.IsTrue(pt1.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                    .ID));
 }