public void FindAddressCandidatesWithoutTokenReturnsSuccess() { GeocodeParameters gcParams = CreateTestGeocodeParamsSingleLineBasic(); GeocodeService service = new GeocodeService(); GeocodeResult result = service.FindAddressCandidates(gcParams); Assert.IsInstanceOfType(result, typeof(GeocodeResult)); Assert.IsNotNull(result.candidates, "Candidates should not be null."); Assert.IsNotNull(result.spatialReference, "Spatial Reference should not be null."); }
public void FindAddressCandidatesMultiLineFull() { GeocodeParameters gcParams = CreateTestGeocodeParamsMultiFieldFull(); Dictionary <string, object> dictOutput = gcParams.ToDictionary(); var test = dictOutput.ToQueryString(); Assert.IsInstanceOfType(test, typeof(string), test); GeocodeService service = new GeocodeService(); GeocodeResult result = service.FindAddressCandidates(gcParams, this.Token); Assert.IsInstanceOfType(result, typeof(GeocodeResult)); Assert.IsNotNull(result.candidates, "Candidates should not be null."); Assert.IsNotNull(result.spatialReference, "Spatial Reference should not be null."); }
public void FindAddressCandidatesWithoutTokenForStorageThrowsException() { GeocodeParameters gcParams = CreateTestGeocodeParamsSingleLineBasic(); gcParams.forStorage = true; GeocodeService service = new GeocodeService(); try { GeocodeResult result = service.FindAddressCandidates(gcParams); } catch (Exception ex) { Assert.IsInstanceOfType(ex, typeof(GeocodeException)); } }
public void FindAddressCandidatesMultiLineBasic() { string multiLineBasicJson = "address=James+Madison+Park&address2=614+E+Gorham+St&address3=Basketball+courts&neighborhood=Downtown&city=Madison&subregion=Dane+County®ion=WI&postal=53703&countryCode=USA&location=%5b-89.383%2c43.081%5d&forStorage=False&locationType=rooftop&f=json"; GeocodeParameters gcParams = CreateTestGeocodeParamsMultiFieldBasic(); Dictionary <string, object> dictOutput = gcParams.ToDictionary(); var test = dictOutput.ToQueryString(); Assert.IsInstanceOfType(test, typeof(string), test); Assert.AreEqual(test, multiLineBasicJson); GeocodeService service = new GeocodeService(); GeocodeResult result = service.FindAddressCandidates(gcParams, this.Token); Assert.IsInstanceOfType(result, typeof(GeocodeResult)); Assert.IsNotNull(result.candidates, "Candidates should not be null."); Assert.IsNotNull(result.spatialReference, "Spatial Reference should not be null."); }
public void FindAddressCandidatesSingleLineBasic() { string singleLineBasicJson = "singleLine=614+E+Gorham+St&location=%5b-89.383%2c43.081%5d&outFields=NAME&forStorage=False&locationType=rooftop&f=json"; GeocodeParameters gcParams = CreateTestGeocodeParamsSingleLineBasic(); Dictionary <string, object> dictOutput = gcParams.ToDictionary(); string queryString = dictOutput.ToQueryString(); Assert.IsInstanceOfType(queryString, typeof(string), queryString); Assert.AreEqual(queryString, singleLineBasicJson); GeocodeService service = new GeocodeService(); GeocodeResult result = service.FindAddressCandidates(gcParams, this.Token); Assert.IsInstanceOfType(result, typeof(GeocodeResult)); Assert.IsNotNull(result.candidates, "Candidates should not be null."); Assert.IsNotNull(result.spatialReference, "Spatial Reference should not be null."); }