Example #1
0
 public virtual void TestPoint()
 {
     com.epl.geometry.Point pt = new com.epl.geometry.Point();
     pt.SetXY(100, 200);
     NUnit.Framework.Assert.IsFalse(pt.HasAttribute(com.epl.geometry.VertexDescription.Semantics.M));
     pt.AddAttribute(com.epl.geometry.VertexDescription.Semantics.M);
     NUnit.Framework.Assert.IsTrue(pt.HasAttribute(com.epl.geometry.VertexDescription.Semantics.M));
     NUnit.Framework.Assert.IsTrue(double.IsNaN(pt.GetM()));
     pt.SetAttribute(com.epl.geometry.VertexDescription.Semantics.M, 0, 13);
     NUnit.Framework.Assert.IsTrue(pt.GetM() == 13);
     pt.AddAttribute(com.epl.geometry.VertexDescription.Semantics.Z);
     NUnit.Framework.Assert.IsTrue(pt.GetZ() == 0);
     NUnit.Framework.Assert.IsTrue(pt.GetM() == 13);
     pt.SetAttribute(com.epl.geometry.VertexDescription.Semantics.Z, 0, 11);
     NUnit.Framework.Assert.IsTrue(pt.GetZ() == 11);
     NUnit.Framework.Assert.IsTrue(pt.GetM() == 13);
     pt.AddAttribute(com.epl.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.epl.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.epl.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.epl.geometry.VertexDescription.Semantics.M));
     com.epl.geometry.Point pt1 = new com.epl.geometry.Point();
     NUnit.Framework.Assert.IsFalse(pt1.HasAttribute(com.epl.geometry.VertexDescription.Semantics.M));
     NUnit.Framework.Assert.IsFalse(pt1.HasAttribute(com.epl.geometry.VertexDescription.Semantics.Z));
     NUnit.Framework.Assert.IsFalse(pt1.HasAttribute(com.epl.geometry.VertexDescription.Semantics.ID));
     pt1.MergeVertexDescription(pt.GetDescription());
     NUnit.Framework.Assert.IsFalse(pt1.HasAttribute(com.epl.geometry.VertexDescription.Semantics.M));
     NUnit.Framework.Assert.IsTrue(pt1.HasAttribute(com.epl.geometry.VertexDescription.Semantics.Z));
     NUnit.Framework.Assert.IsTrue(pt1.HasAttribute(com.epl.geometry.VertexDescription.Semantics.ID));
 }