public virtual void TestReplaceNaNs() { com.esri.core.geometry.Envelope env = new com.esri.core.geometry.Envelope(); com.esri.core.geometry.Point pt = new com.esri.core.geometry.Point(); pt.SetXY(1, 2); pt.SetZ(double.NaN); pt.QueryEnvelope(env); pt.ReplaceNaNs(com.esri.core.geometry.VertexDescription.Semantics.Z, 5); NUnit.Framework.Assert.IsTrue(pt.Equals(new com.esri.core.geometry.Point(1, 2, 5))); NUnit.Framework.Assert.IsTrue(env.HasZ()); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).IsEmpty()); env.ReplaceNaNs(com.esri.core.geometry.VertexDescription.Semantics.Z, 5); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).Equals(new com.esri.core.geometry.Envelope1D(5, 5))); }
public virtual void TestEnvelope() { com.esri.core.geometry.Envelope env = new com.esri.core.geometry.Envelope(); env.SetCoords(100, 200, 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)); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.M, 0).IsEmpty()); env.SetInterval(com.esri.core.geometry.VertexDescription.Semantics.M, 0, 1, 2); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.M, 0).vmin == 1); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.M, 0).vmax == 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)); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).vmin == 0); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).vmax == 0); env.SetInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0, 3, 4); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).vmin == 3); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).vmax == 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)); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.ID, 0).vmin == 0); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.ID, 0).vmax == 0); env.SetInterval(com.esri.core.geometry.VertexDescription.Semantics.ID, 0, 5, 6); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.ID, 0).vmin == 5); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.ID, 0).vmax == 6); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).vmin == 3); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).vmax == 4); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.M, 0).vmin == 1); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.M, 0).vmax == 2); 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.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.ID, 0).vmin == 5); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.ID, 0).vmax == 6); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).vmin == 3); NUnit.Framework.Assert.IsTrue(env.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).vmax == 4); com.esri.core.geometry.Envelope env1 = new com.esri.core.geometry.Envelope(); env.CopyTo(env1); NUnit.Framework.Assert.IsFalse(env1.HasAttribute(com.esri.core.geometry.VertexDescription.Semantics.M)); NUnit.Framework.Assert.IsTrue(env1.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.ID, 0).vmin == 5); NUnit.Framework.Assert.IsTrue(env1.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.ID, 0).vmax == 6); NUnit.Framework.Assert.IsTrue(env1.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).vmin == 3); NUnit.Framework.Assert.IsTrue(env1.QueryInterval(com.esri.core.geometry.VertexDescription.Semantics.Z, 0).vmax == 4); }