Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldNotCreateIndexSpecificSettingForReadRequest()
        internal virtual void ShouldNotCreateIndexSpecificSettingForReadRequest()
        {
            // given
            IDictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings> initialSettings = new Dictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings>();

            initialSettings[WGS84]     = _globalSettings.forCRS(WGS84);
            initialSettings[Cartesian] = _globalSettings.forCRS(Cartesian);
            IndexSpecificSpaceFillingCurveSettingsCache indexSettings = new IndexSpecificSpaceFillingCurveSettingsCache(_globalSettings, initialSettings);

            // when
            indexSettings.ForCrs(Cartesian_3D, false);

            // then
            ToMapSettingVisitor visitor = new ToMapSettingVisitor();

            indexSettings.VisitIndexSpecificSettings(visitor);
            assertEquals(initialSettings, visitor.Map);
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHaveInitialIndexSpecificSettingsPlusRequestedOnes()
        internal virtual void ShouldHaveInitialIndexSpecificSettingsPlusRequestedOnes()
        {
            // given
            IDictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings> initialSettings = new Dictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings>();

            initialSettings[WGS84]     = _globalSettings.forCRS(WGS84);
            initialSettings[Cartesian] = _globalSettings.forCRS(Cartesian);
            IndexSpecificSpaceFillingCurveSettingsCache indexSettings = new IndexSpecificSpaceFillingCurveSettingsCache(_globalSettings, initialSettings);

            // when
            indexSettings.ForCrs(Cartesian_3D, true);

            // then
            ToMapSettingVisitor visitor = new ToMapSettingVisitor();

            indexSettings.VisitIndexSpecificSettings(visitor);
            IDictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings> expectedSettings = new Dictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings>(initialSettings);

            assertNull(expectedSettings.put(Cartesian_3D, _globalSettings.forCRS(Cartesian_3D)));
            assertEquals(expectedSettings, visitor.Map);
        }
Example #3
0
        private void ShouldWriteAndReadSettings(params CoordinateReferenceSystem[] crss)
        {
            // given
            IndexSpecificSpaceFillingCurveSettingsCache indexSettings = new IndexSpecificSpaceFillingCurveSettingsCache(new ConfiguredSpaceFillingCurveSettingsCache(Config.defaults()), new Dictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings>());

            foreach (CoordinateReferenceSystem crs in crss)
            {
                indexSettings.ForCrs(crs, true);
            }
            SpaceFillingCurveSettingsWriter writer = new SpaceFillingCurveSettingsWriter(indexSettings);

            // when
            writer.Accept(_pageCursor);
            _pageCursor.rewind();

            // then
            IDictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings> read = new Dictionary <CoordinateReferenceSystem, SpaceFillingCurveSettings>();
            SpaceFillingCurveSettingsReader reader = new SpaceFillingCurveSettingsReader(read);

            reader.Read(ByteBuffer.wrap(_data));
            assertEquals(AsMap(indexSettings), read);
        }