コード例 #1
0
        public void GetRegionsGeographyByGuids()
        {
            List <String>             guids;
            List <WebRegionGeography> regionsGeography;
            WebCoordinateSystem       coordinateSystem;

            coordinateSystem    = new WebCoordinateSystem();
            coordinateSystem.Id = CoordinateSystemId.GoogleMercator;

            guids            = null;
            regionsGeography = RegionManager.GetRegionsGeographyByGuids(GetContext(ApplicationIdentifier.ArtDatabankenSOA), guids, coordinateSystem);
            Assert.IsTrue(regionsGeography.IsEmpty());

            guids            = new List <String>();
            regionsGeography = RegionManager.GetRegionsGeographyByGuids(GetContext(), guids, coordinateSystem);
            Assert.IsTrue(regionsGeography.IsEmpty());

            guids = new List <String>();
            guids.Add(Settings.Default.ProvinceSkaneGUID);
            guids.Add(Settings.Default.ProvinceBlekingeGUID);
            regionsGeography = RegionManager.GetRegionsGeographyByGuids(GetContext(), guids, coordinateSystem);
            Assert.IsTrue(regionsGeography.IsNotEmpty());
            Assert.AreEqual(guids.Count, regionsGeography.Count);

            // Test GUID with character '.
            //guids = new List<String>();
            //guids.Add("URN:LSID:artportalen.se:area:DataSet16'Feature2");
            //regionsGeography = RegionManager.GetRegionsGeographyByGuids(GetContext(), guids, coordinateSystem);
            //Assert.IsTrue(regionsGeography.IsEmpty());
        }
コード例 #2
0
        public void GetRegionsGeographyByGuidsNullCoordinateSystemError()
        {
            List <String>             guids;
            List <WebRegionGeography> regionsGeography;
            WebCoordinateSystem       coordinateSystem;

            coordinateSystem = null;
            guids            = null;
            regionsGeography = RegionManager.GetRegionsGeographyByGuids(GetContext(ApplicationIdentifier.ArtDatabankenSOA), guids, coordinateSystem);
            Assert.IsTrue(regionsGeography.IsEmpty());
        }
コード例 #3
0
        public void GetRegionsGeographyByGuidsAccessRightsError()
        {
            List <String>             guids;
            List <WebRegionGeography> regionsGeography;
            WebCoordinateSystem       coordinateSystem;

            coordinateSystem    = new WebCoordinateSystem();
            coordinateSystem.Id = CoordinateSystemId.GoogleMercator;

            guids            = null;
            regionsGeography = RegionManager.GetRegionsGeographyByGuids(GetContext(ApplicationIdentifier.UserAdmin),
                                                                        guids,
                                                                        coordinateSystem);
            Assert.IsTrue(regionsGeography.IsEmpty());
        }
コード例 #4
0
        public void GetRegionsGeographyByIds()
        {
            List <Int32>              regionIds;
            List <String>             regionGuids;
            List <WebRegionGeography> regionsGeography;
            WebCoordinateSystem       coordinateSystem;

            regionGuids = new List <String>();
            regionGuids.Add("URN:LSID:artportalen.se:area:DataSet16Feature1");
            regionGuids.Add("URN:LSID:artportalen.se:area:DataSet16Feature2");
            coordinateSystem    = new WebCoordinateSystem();
            coordinateSystem.Id = CoordinateSystemId.GoogleMercator;
            regionsGeography    = RegionManager.GetRegionsGeographyByGuids(GetContext(ApplicationIdentifier.ArtDatabankenSOA), regionGuids, coordinateSystem);
            Assert.IsTrue(regionsGeography.IsNotEmpty());
            Assert.AreEqual(regionGuids.Count, regionsGeography.Count);
            regionIds = new List <Int32>();
            foreach (WebRegionGeography webRegionGeography in regionsGeography)
            {
                regionIds.Add(webRegionGeography.Id);
            }
            regionsGeography = RegionManager.GetRegionsGeographyByIds(GetContext(ApplicationIdentifier.ArtDatabankenSOA), regionIds, coordinateSystem);
            Assert.IsTrue(regionsGeography.IsNotEmpty());
            Assert.AreEqual(regionIds.Count, regionsGeography.Count);
        }