Exemplo n.º 1
0
 public virtual void testLine()
 {
     com.esri.core.geometry.Line env = new com.esri.core.geometry.Line();
     env.setStartXY(100, 200);
     env.setEndXY(250, 300);
     NUnit.Framework.Assert.IsFalse(env.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                     .M));
     env.addAttribute(com.esri.core.geometry.VertexDescription.Semantics.M);
     NUnit.Framework.Assert.IsTrue(env.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                    .M));
     env.setStartAttribute(com.esri.core.geometry.VertexDescription.Semantics.M, 0, 1);
     env.setEndAttribute(com.esri.core.geometry.VertexDescription.Semantics.M, 0, 2);
     NUnit.Framework.Assert.IsTrue(env.getStartAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                              .M, 0) == 1);
     NUnit.Framework.Assert.IsTrue(env.getEndAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                            .M, 0) == 2);
     NUnit.Framework.Assert.IsFalse(env.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                     .Z));
     env.addAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z);
     NUnit.Framework.Assert.IsTrue(env.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                    .Z));
     env.setStartAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 0, 3);
     env.setEndAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 0, 4);
     NUnit.Framework.Assert.IsTrue(env.getStartAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                              .Z, 0) == 3);
     NUnit.Framework.Assert.IsTrue(env.getEndAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                            .Z, 0) == 4);
     NUnit.Framework.Assert.IsFalse(env.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                     .ID));
     env.addAttribute(com.esri.core.geometry.VertexDescription.Semantics.ID);
     NUnit.Framework.Assert.IsTrue(env.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                    .ID));
     env.setStartAttribute(com.esri.core.geometry.VertexDescription.Semantics.ID, 0, 5
                           );
     env.setEndAttribute(com.esri.core.geometry.VertexDescription.Semantics.ID, 0, 6);
     NUnit.Framework.Assert.IsTrue(env.getStartAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                              .ID, 0) == 5);
     NUnit.Framework.Assert.IsTrue(env.getEndAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                            .ID, 0) == 6);
     NUnit.Framework.Assert.IsTrue(env.getStartAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                              .M, 0) == 1);
     NUnit.Framework.Assert.IsTrue(env.getEndAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                            .M, 0) == 2);
     NUnit.Framework.Assert.IsTrue(env.getStartAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                              .Z, 0) == 3);
     NUnit.Framework.Assert.IsTrue(env.getEndAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                            .Z, 0) == 4);
     env.dropAttribute(com.esri.core.geometry.VertexDescription.Semantics.M);
     NUnit.Framework.Assert.IsFalse(env.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                     .M));
     NUnit.Framework.Assert.IsTrue(env.getStartAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                              .ID, 0) == 5);
     NUnit.Framework.Assert.IsTrue(env.getEndAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                            .ID, 0) == 6);
     NUnit.Framework.Assert.IsTrue(env.getStartAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                              .Z, 0) == 3);
     NUnit.Framework.Assert.IsTrue(env.getEndAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                            .Z, 0) == 4);
     com.esri.core.geometry.Line env1 = new com.esri.core.geometry.Line();
     env.copyTo(env1);
     NUnit.Framework.Assert.IsFalse(env1.hasAttribute(com.esri.core.geometry.VertexDescription.Semantics
                                                      .M));
     NUnit.Framework.Assert.IsTrue(env.getStartAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                              .ID, 0) == 5);
     NUnit.Framework.Assert.IsTrue(env.getEndAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                            .ID, 0) == 6);
     NUnit.Framework.Assert.IsTrue(env.getStartAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                              .Z, 0) == 3);
     NUnit.Framework.Assert.IsTrue(env.getEndAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics
                                                            .Z, 0) == 4);
 }