Пример #1
0
        public void TestEqualsExactForLineStrings()
        {
            var x = geometryFactory.CreateLineString(new Coordinate[] {
                new Coordinate(0, 0), new Coordinate(100, 0),
                new Coordinate(100, 100)
            });
            var somethingExactlyEqual = geometryFactory.CreateLineString(new Coordinate[] {
                new Coordinate(0, 0), new Coordinate(100, 0),
                new Coordinate(100, 100)
            });
            var somethingNotEqualButSameClass = geometryFactory.CreateLineString(new Coordinate[] {
                new Coordinate(0, 0), new Coordinate(100, 0),
                new Coordinate(100, 555)
            });
            var sameClassButEmpty        = geometryFactory.CreateLineString((Coordinate[])null);
            var anotherSameClassButEmpty = geometryFactory.CreateLineString((Coordinate[])null);
            var collectionFactory        = new LineCollectionFactory();

            DoTestEqualsExact(x, somethingExactlyEqual,
                              somethingNotEqualButSameClass, sameClassButEmpty,
                              anotherSameClassButEmpty, collectionFactory);

            var collectionFactory2 = new LineCollectionFactory();

            DoTestEqualsExact(x, somethingExactlyEqual,
                              somethingNotEqualButSameClass, sameClassButEmpty,
                              anotherSameClassButEmpty, collectionFactory2);
        }
Пример #2
0
        public void TestEqualsExactForLinearRings()
        {
            var x = geometryFactory.CreateLinearRing(new Coordinate[] {
                new Coordinate(0, 0), new Coordinate(100, 0),
                new Coordinate(100, 100), new Coordinate(0, 0)
            });
            var somethingExactlyEqual = geometryFactory.CreateLinearRing(new Coordinate[] {
                new Coordinate(0, 0), new Coordinate(100, 0),
                new Coordinate(100, 100), new Coordinate(0, 0)
            });
            var somethingNotEqualButSameClass = geometryFactory.CreateLinearRing(new Coordinate[] {
                new Coordinate(0, 0), new Coordinate(100, 0),
                new Coordinate(100, 555), new Coordinate(0, 0)
            });
            var sameClassButEmpty        = geometryFactory.CreateLinearRing((ICoordinateSequence)null);
            var anotherSameClassButEmpty = geometryFactory.CreateLinearRing((ICoordinateSequence)null);
            var collectionFactory        = new LineCollectionFactory();

            DoTestEqualsExact(x, somethingExactlyEqual,
                              somethingNotEqualButSameClass, sameClassButEmpty,
                              anotherSameClassButEmpty, collectionFactory);

            //    LineString somethingEqualButNotExactly = geometryFactory.createLineString(new Coordinate[] {
            //          new Coordinate(0, 0), new Coordinate(100, 0), new Coordinate(100, 100),
            //          new Coordinate(0, 0) });
            //
            //    doTestEqualsExact(x, somethingExactlyEqual, somethingEqualButNotExactly,
            //          somethingNotEqualButSameClass);
        }