コード例 #1
0
        void CheckEmpty(MKPolyline pl)
        {
            // MKAnnotation
            Assert.That(pl.Coordinate.Longitude, Is.NaN, "Coordinate.Longitude");
            if (TestRuntime.CheckXcodeVersion(5, 0, 1))
            {
                Assert.That(pl.Coordinate.Latitude, Is.EqualTo(-90f), "Coordinate.Latitude");
            }
            else
            {
                Assert.That(pl.Coordinate.Latitude, Is.NaN, "Coordinate.Latitude");
            }
            Assert.Null(pl.Title, "Title");
            Assert.Null(pl.Subtitle, "Subtitle");
            // MKOverlay
            Assert.True(Double.IsPositiveInfinity(pl.BoundingMapRect.Origin.X), "BoundingMapRect.Origin.X");
            Assert.True(Double.IsPositiveInfinity(pl.BoundingMapRect.Origin.Y), "BoundingMapRect.Origin.Y");
            if (TestRuntime.CheckXcodeVersion(5, 0, 1))
            {
                Assert.That(pl.BoundingMapRect.Size.Height, Is.EqualTo(0.0f), "BoundingMapRect.Size.Height");
                Assert.That(pl.BoundingMapRect.Size.Width, Is.EqualTo(0.0f), "BoundingMapRect.Size.Width");
            }
            else
            {
                Assert.True(Double.IsNegativeInfinity(pl.BoundingMapRect.Size.Height), "BoundingMapRect.Size.Height");
                Assert.True(Double.IsNegativeInfinity(pl.BoundingMapRect.Size.Width), "BoundingMapRect.Size.Width");
            }
            Assert.False(pl.Intersects(pl.BoundingMapRect), "Intersect/Self");
            MKMapRect rect = new MKMapRect(0, 0, 0, 0);

            Assert.False(pl.Intersects(rect), "Intersect/Empty");

            ShapeTest.CheckShape(pl);
        }
コード例 #2
0
        void CheckEmpty(MKPolygon pg)
        {
            // MKAnnotation
            Assert.That(pg.Coordinate.Longitude, Is.NaN, "Coordinate.Longitude");
            Assert.That(pg.Coordinate.Latitude, Is.NaN, "Coordinate.Latitude");
            Assert.Null(pg.Title, "Title");
            Assert.Null(pg.Subtitle, "Subtitle");
            // MKOverlay
            Assert.True(Double.IsPositiveInfinity(pg.BoundingMapRect.Origin.X), "BoundingMapRect.Origin.X");
            Assert.True(Double.IsPositiveInfinity(pg.BoundingMapRect.Origin.Y), "BoundingMapRect.Origin.Y");
            Assert.True(Double.IsNegativeInfinity(pg.BoundingMapRect.Size.Height), "BoundingMapRect.Size.Height");
            Assert.True(Double.IsNegativeInfinity(pg.BoundingMapRect.Size.Width), "BoundingMapRect.Size.Width");
            Assert.False(pg.Intersects(pg.BoundingMapRect), "Intersect/Self");
            MKMapRect rect = new MKMapRect(0, 0, 0, 0);

            Assert.False(pg.Intersects(rect), "Intersect/Empty");

            ShapeTest.CheckShape(pg);
        }