public void Get_WFSCapabilities_From_Server() { var smhi100 = WFSManager.GetWFSCapabilities("http://map.smhi.se/geoserver/ows?", WFSVersion.Ver100); Assert.IsTrue(smhi100.Version == "1.0.0"); var smhi110 = WFSManager.GetWFSCapabilities("http://map.smhi.se/geoserver/ows?", WFSVersion.Ver110); Assert.IsTrue(smhi110.Version == "1.1.0"); }
public void GetWFSCapabilities_LocalCapabilitiesFile_SuccessfulParse() { using (ShimsContext.Create()) { ShimWebClient.AllInstances.DownloadStringString = (client, url2) => File.ReadAllText(@"Sample files\smhi getcapabilities.xml"); WFSCapabilities capabilities; String url; url = "http://map.smhi.se/geoserver/ows"; capabilities = WFSManager.GetWFSCapabilities(url, WFSVersion.Ver100); Assert.AreEqual(132, capabilities.FeatureTypes.Count); Assert.AreEqual("1.0.0", capabilities.Version); Assert.AreEqual("http://map.smhi.se/geoserver/wfs?request=DescribeFeatureType", capabilities.Capability.Requests.DescribeFeatureTypeRequest.GetUrl); } }
public void Get_WFSDescribeFeatures_From_Server() { Dictionary <string, WFSDescribeFeatureType> dicDescribeFeatures; WFSCapabilities capabilities; String url; url = "http://map.smhi.se/geoserver/ows"; capabilities = WFSManager.GetWFSCapabilities(url); dicDescribeFeatures = WFSManager.GetWFSDescribeFeatureTypes(url, capabilities.FeatureTypes); Assert.IsTrue(dicDescribeFeatures.Count > 0); Assert.IsTrue(dicDescribeFeatures.Count == capabilities.FeatureTypes.Count); url = "http://map.smhi.se/geoserver/ows"; capabilities = WFSManager.GetWFSCapabilities(url, WFSVersion.Ver110); dicDescribeFeatures = WFSManager.GetWFSDescribeFeatureTypes(url, capabilities.FeatureTypes, WFSVersion.Ver110); Assert.IsTrue(dicDescribeFeatures.Count > 0); Assert.IsTrue(dicDescribeFeatures.Count == capabilities.FeatureTypes.Count); }