public void RouteRequest_ToString_WithDateNotSet_MustThrowArgumentException()
 {
     var requestEntity = new RoutesRequest
     {
         RouteCodes = new List<string>() { "333", "130" },
         VehicleTypes = new List<VehicleType>() { VehicleType.Bus, VehicleType.Train }
     };
     string expected = requestEntity.ToString();
 }
        public void RouteRequest_ToString_WithMandatoryValuesSet_MustReturnCorrectQueryString()
        {
            var requestEntity = new RoutesRequest
            {
                Date = DateTime.Now.AddDays(1),
                RouteCodes = new List<string>() { "333", "130" },
                VehicleTypes = new List<VehicleType>() { VehicleType.Bus, VehicleType.Train }
            };

            string expected = string.Format("routes?date={0}&vehicleTypes=2,8&routeCodes=333,130", DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"));
            string actual = requestEntity.ToString();
            Assert.AreEqual(expected, actual);
        }
 public async Task<HttpResponseMessage> GetRoutes(RoutesRequest request)
 {
     var result = CheckCacheForEntry<IRequest, RoutesResponse>(request);
     if (result == null)
     {
         Logger.DebugFormat("Getting {0} from web: ", request.ToString());
         result = await new OpiaNetworkClient().GetRoutesAsync(request);
         await StoreResultInCache<IRequest, RoutesResponse>(request, result);
     }
     var response = Request.CreateResponse(HttpStatusCode.OK, result);
     return response;
 }