Exemplo n.º 1
0
        public void VerifyGetObjectFromRemoteServer()
        {
            RouteServiceProxy proxy       = new RouteServiceProxy(LocalServiceUrl);
            Route             routeActual = proxy.GetRoute("seattle-wa-united-states-to-tacoma-wa-united-states", LOCATIONSeattle, LOCATIONTacoma, new RouteOptions()
            {
                ExcludeJunctionsWithoutExitInfo = false
            });
            Route routeExpected = GetRouteFromServiceController(LOCATIONSeattle, LOCATIONTacoma);

            routeActual.Diagnostics   = null;
            routeExpected.Diagnostics = null;

            Assert.AreEqual <string>(JsonConvert.SerializeObject(routeExpected), JsonConvert.SerializeObject(routeActual));
        }
Exemplo n.º 2
0
        private static IRouteService CreateRouteServiceInstance()
        {
            IRouteService service = null;

            if (WebConfigurationManager.AppSettings["proxyservice"] == "false")
            {
                var serviceAssembly = Assembly.Load("Yojowa.StopByStop.Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
                var serviceType     = serviceAssembly.GetType("Yojowa.StopByStop.Service.StopByStopService");
                service = (IRouteService)Activator.CreateInstance(serviceType);
            }
            else
            {
                service = new RouteServiceProxy(WebConfigurationManager.AppSettings["proxyserviceurl"]);
            }

            return(service);
        }