public void AddOrReplaceSrsInUrl_UrlContainingSrs_SrsIsReplaced() { string newSrsName = "EPSG:1001"; string featuresUrl = "http://slwgeo.artdata.slu.se:8080/geoserver/wfs?&service=wfs&request=GetFeature&version=1.1.0&typeName=SLW:Sverigekarta_med_lan&srsName=EPSG:3857"; string newUrl = WFSManager.AddOrReplaceSrsInUrl(featuresUrl, newSrsName); Assert.IsTrue(WFSManager.GetCoordinateSystemSrsFromUrl(newUrl) == newSrsName); // Google mercator featuresUrl = "http://slwgeo.artdata.slu.se:8080/geoserver/wfs?&service=wfs&request=GetFeature&version=1.1.0&typeName=SLW:Sverigekarta_med_lan&srsName=EPSG:900913"; newUrl = WFSManager.AddOrReplaceSrsInUrl(featuresUrl, newSrsName); Assert.IsTrue(WFSManager.GetCoordinateSystemSrsFromUrl(newUrl) == newSrsName); // extra space in the end featuresUrl = "http://slwgeo.artdata.slu.se:8080/geoserver/wfs?&service=wfs&request=GetFeature&version=1.1.0&typeName=SLW:Sverigekarta_med_lan&srsName=EPSG:900913 "; newUrl = WFSManager.AddOrReplaceSrsInUrl(featuresUrl, newSrsName); Assert.IsTrue(WFSManager.GetCoordinateSystemSrsFromUrl(newUrl) == newSrsName); // inside the url featuresUrl = "http://slwgeo.artdata.slu.se:8080/geoserver/wfs?&service=wfs&request=GetFeature&srsName=EPSG:900913&version=1.1.0&typeName=SLW:Sverigekarta_med_lan"; newUrl = WFSManager.AddOrReplaceSrsInUrl(featuresUrl, newSrsName); Assert.IsTrue(WFSManager.GetCoordinateSystemSrsFromUrl(newUrl) == newSrsName); // inside the url same srs name featuresUrl = "http://slwgeo.artdata.slu.se:8080/geoserver/wfs?&service=wfs&request=GetFeature&srsName=EPSG:1001&version=1.1.0&typeName=SLW:Sverigekarta_med_lan"; newUrl = WFSManager.AddOrReplaceSrsInUrl(featuresUrl, newSrsName); Assert.IsTrue(WFSManager.GetCoordinateSystemSrsFromUrl(newUrl) == newSrsName); }
public void AddOrReplaceSrsInUrl_UrlWithoutSrs_SrsIsAdded() { string newSrsName = "EPSG:1001"; string featuresUrl = "http://slwgeo.artdata.slu.se:8080/geoserver/wfs?&service=wfs&request=GetFeature&version=1.1.0&typeName=SLW:Sverigekarta_med_lan"; string newUrl = WFSManager.AddOrReplaceSrsInUrl(featuresUrl, newSrsName); Assert.IsTrue(WFSManager.GetCoordinateSystemSrsFromUrl(newUrl) == newSrsName); }