public async Task<HttpResponseMessage> GetStopsAtLandmark(StopsAtLandmarkRequest request) { var result = CheckCacheForEntry<IRequest, StopsAtLandmarkResponse>(request); if (result == null) { Logger.DebugFormat("Getting {0} from web: ", request.ToString()); result = await new OpiaLocationClient().GetStopsAtLandmarkAsync(request); await StoreResultInCache<IRequest, StopsAtLandmarkResponse>(request, result); } var response = Request.CreateResponse(HttpStatusCode.OK, result); return response; }
public void StopsAtLandmarkRequest_ToString_WithNonEmptyLookupId_MustReturnCorrectQueryString() { var requestEntity = new StopsAtLandmarkRequest {LocationId = "some test landmark"}; const string expected = "stops-at-landmark/some%20test%20landmark"; // note the use of a '/' instead of the usual '?' string actual = requestEntity.ToString(); Assert.AreEqual(expected, actual); }
public void StopsAtLandmarkRequest_ToString_WithEmptyLookupId_MustThrowArgumentException() { var requestEntity = new StopsAtLandmarkRequest(); string expected = requestEntity.ToString(); }