Ejemplo n.º 1
0
 public virtual void testEnvelope2D_corners()
 {
     com.esri.core.geometry.Envelope2D env = new com.esri.core.geometry.Envelope2D(0,
                                                                                   1, 2, 3);
     NUnit.Framework.Assert.IsFalse(env.Equals(null));
     NUnit.Framework.Assert.IsTrue(env.Equals((object)new com.esri.core.geometry.Envelope2D
                                                  (0, 1, 2, 3)));
     com.esri.core.geometry.Point2D pt2D = env.getLowerLeft();
     NUnit.Framework.Assert.IsTrue(pt2D.equals(com.esri.core.geometry.Point2D.construct
                                                   (0, 1)));
     pt2D = env.getUpperLeft();
     NUnit.Framework.Assert.IsTrue(pt2D.equals(com.esri.core.geometry.Point2D.construct
                                                   (0, 3)));
     pt2D = env.getUpperRight();
     NUnit.Framework.Assert.IsTrue(pt2D.equals(com.esri.core.geometry.Point2D.construct
                                                   (2, 3)));
     pt2D = env.getLowerRight();
     NUnit.Framework.Assert.IsTrue(pt2D.equals(com.esri.core.geometry.Point2D.construct
                                                   (2, 1)));
     {
         com.esri.core.geometry.Point2D[] corners = new com.esri.core.geometry.Point2D[4];
         env.queryCorners(corners);
         NUnit.Framework.Assert.IsTrue(corners[0].equals(com.esri.core.geometry.Point2D.construct
                                                             (0, 1)));
         NUnit.Framework.Assert.IsTrue(corners[1].equals(com.esri.core.geometry.Point2D.construct
                                                             (0, 3)));
         NUnit.Framework.Assert.IsTrue(corners[2].equals(com.esri.core.geometry.Point2D.construct
                                                             (2, 3)));
         NUnit.Framework.Assert.IsTrue(corners[3].equals(com.esri.core.geometry.Point2D.construct
                                                             (2, 1)));
         env.queryCorners(corners);
         NUnit.Framework.Assert.IsTrue(corners[0].equals(env.queryCorner(0)));
         NUnit.Framework.Assert.IsTrue(corners[1].equals(env.queryCorner(1)));
         NUnit.Framework.Assert.IsTrue(corners[2].equals(env.queryCorner(2)));
         NUnit.Framework.Assert.IsTrue(corners[3].equals(env.queryCorner(3)));
     }
     {
         com.esri.core.geometry.Point2D[] corners = new com.esri.core.geometry.Point2D[4];
         env.queryCornersReversed(corners);
         NUnit.Framework.Assert.IsTrue(corners[0].equals(com.esri.core.geometry.Point2D.construct
                                                             (0, 1)));
         NUnit.Framework.Assert.IsTrue(corners[1].equals(com.esri.core.geometry.Point2D.construct
                                                             (2, 1)));
         NUnit.Framework.Assert.IsTrue(corners[2].equals(com.esri.core.geometry.Point2D.construct
                                                             (2, 3)));
         NUnit.Framework.Assert.IsTrue(corners[3].equals(com.esri.core.geometry.Point2D.construct
                                                             (0, 3)));
         env.queryCornersReversed(corners);
         NUnit.Framework.Assert.IsTrue(corners[0].equals(env.queryCorner(0)));
         NUnit.Framework.Assert.IsTrue(corners[1].equals(env.queryCorner(3)));
         NUnit.Framework.Assert.IsTrue(corners[2].equals(env.queryCorner(2)));
         NUnit.Framework.Assert.IsTrue(corners[3].equals(env.queryCorner(1)));
     }
     NUnit.Framework.Assert.IsTrue(env.getCenter().equals(com.esri.core.geometry.Point2D
                                                          .construct(1, 2)));
     NUnit.Framework.Assert.IsFalse(env.containsExclusive(env.getUpperLeft()));
     NUnit.Framework.Assert.IsTrue(env.contains(env.getUpperLeft()));
     NUnit.Framework.Assert.IsTrue(env.containsExclusive(env.getCenter()));
 }