public async Task List_ReturnsCorrectView() { _routeServiceMock = new Mock <IRouteService>(); _routeServiceMock.Setup(r => r.SearchAsync(It.IsAny <SearchRouteSortableViewModel>())).Returns(Task.FromResult(_searchableRoutes.Where(r => r.SygmaCenterNo == 22).Take(5))); _routeService = _routeServiceMock.Object; RouteManagerController controller = new RouteManagerController(_routeService, null, null, null) { ControllerContext = new ControllerContext() { HttpContext = _contextMock.Object } }; var position = "left"; var incomingModel = new SearchRouteSortableViewModel { SortDirection = SortDirections.Ascending, SortField = RouteSortFields.Weight, NearRoutePlanId = 0 }; var result = await controller.List(position, incomingModel) as PartialViewResult; var model = result.ViewData.Model as RouteListViewModel; Assert.AreEqual("_routeList", result.ViewName); Assert.IsNotNull(model); Assert.AreEqual(position, model.Position); Assert.AreEqual(incomingModel.SortDirection, model.SortDirection); Assert.AreEqual(incomingModel.SortField, model.SortField); Assert.AreEqual(incomingModel.NearRoutePlanId != 0, model.StopProximitySearch); }
public TravelRouteController(IUserInterface userInterface, IRouteReader routeReader, IRouteService routeService, IBestRouteService bestRouteService) { this.userInterface = userInterface; this.routeReader = routeReader; this.routeService = routeService; this.bestRouteService = bestRouteService; }
public EmployeeDetailService( IDepartmentService departmentService, ISectionService sectionService, IShiftService shiftService, IJobPositionService jobPositionService, IJobFunctionService jobFunctionService, IEmployeeLevelService levelService, IRouteService routeService, IBusStationService busStationService, ISkillGroupService skillGroupService, ISkillTypeService skillTypeService, ISkillService skillService) { _departmentService = departmentService; _sectionService = sectionService; _shiftService = shiftService; _jobPositionService = jobPositionService; _jobFunctionService = jobFunctionService; _levelService = levelService; _routeService = routeService; _busStationService = busStationService; _skillGroupService = skillGroupService; _skillTypeService = skillTypeService; _skillService = skillService; }
public void SetUp() { _mockFinder = new Mock<ICoordinateFinder>(); _mockRouteCalculator = new Mock<IRouteCalculator>(); _routeService = new RouteService(_mockFinder.Object, _mockRouteCalculator.Object); }
public void SetUp() { _mockFinder = new Mock <ICoordinateFinder>(); _mockRouteCalculator = new Mock <IRouteCalculator>(); _routeService = new RouteService(_mockFinder.Object, _mockRouteCalculator.Object); }
public void SetUp() { _routeService = new RouteService(); _addressFinderService = new AddressFinderService(); _calculateTotalOfRouteService = new CalculateTotalOfRouteService(_routeService, _addressFinderService); _modelFactory = new ModelFactory(_addressFinderService); }
public DiaryController(IDiaryService diaryService, ISiteService siteService, ITravelService travelService, IRouteService routeService) { this._diaryService = diaryService; this._siteService = siteService; this._travelService = travelService; this._routeService = routeService; }
public async Task Destination_ReturnsCorrectResult() { var centerNumber = 22; var routeId = 132084; var routeNumber = "639T"; var deliveryDate = DateTime.Today; _routeServiceMock = new Mock <IRouteService>(); _routeServiceMock.Setup(r => r.GetByRouteIdAsync(It.IsAny <int>())).Returns(Task.FromResult(_searchableRoutes.First(r => r.RouteId == routeId))); _routeServiceMock.Setup(r => r.GetByRouteIdAndCenterNumberAndRouteNumberAsync(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>())).Returns(Task.FromResult(_searchableRoutes.First(r => r.RouteId == routeId))); _routeService = _routeServiceMock.Object; RouteManagerController controller = new RouteManagerController(_routeService, null, null, null) { ControllerContext = new ControllerContext() { HttpContext = _contextMock.Object } }; var result = await controller.Destination(routeId, centerNumber, routeNumber, deliveryDate) as JsonResult; var model = JsonConvert.DeserializeObject <dynamic>(result.Data.ToString()); Assert.IsNotNull(model); Assert.AreEqual(routeId.ToString(), ((Newtonsoft.Json.Linq.JValue)Newtonsoft.Json.Linq.JObject.Parse(result.Data.ToString())["RouteId"]).Value.ToString()); }
public RoutesController(IRouteService service, IMapper mapper, IErrorHandler errorHandler, IWarehouseService warehouseService) { _service = service; _mapper = mapper; _errorHandler = errorHandler; _warehouseService = warehouseService; }
public HomeController(IStationService IStationService, IPathSearchService IPathSearchService, IRouteService IRouteService, IConnectionService IConnectionService) { _IStationService = IStationService; _IPathSearchService = IPathSearchService; _IRouteService = IRouteService; _IConnectionService = IConnectionService; }
public PRVJTFinder(PRVJTConfig config, IRouteService routeService) { Config = config; GaFinder = new GeneticAlgorithmFinder(routeService, config.Settings); Settings = Config.Settings; RouteService = routeService; }
public LogisticianController(IRouteService routeService, ITrainService trainservice, ICarriageService carriageservice, IRouteDateService routedateservice) { _trainService = trainservice; _carriageService = carriageservice; _routeService = routeService; _routeDateService = routedateservice; }
/// <summary> /// Initializes a new instance of the <see cref="DrayageOptimizer"/> class. /// </summary> /// <param name="probabilityMatrix">The probability matrix.</param> /// <param name="routeService">The route service.</param> /// <param name="routeExitFunction">The route exit function.</param> /// <param name="logger">The logger.</param> /// <param name="pheromoneMatrix">The pheromone matrix.</param> /// <param name="nodeService">The node service.</param> /// <param name="randomNumberGenerator">The random number generator.</param> /// <param name="nodeFactory">The node factory.</param> /// <param name="jobNodeService">The job Node Service.</param> /// <param name="routeStopService">The route stop service.</param> public DrayageOptimizer(IProbabilityMatrix probabilityMatrix, IRouteService routeService, IRouteExitFunction routeExitFunction, ILogger logger, IPheromoneMatrix pheromoneMatrix, IRandomNumberGenerator randomNumberGenerator, IRouteStatisticsService routeStatisticsService, IJobNodeService jobNodeService, IRouteStopService routeStopService) { _probabilityMatrix = probabilityMatrix; _routeExitFunction = routeExitFunction; _logger = logger; _pheromoneMatrix = pheromoneMatrix; _randomNumberGenerator = randomNumberGenerator; _routeStatisticsService = routeStatisticsService; _jobNodeService = jobNodeService; _routeStopService = routeStopService; _routeService = routeService; // default values EnableParallelism = true; PheromoneUpdateFrequency = 5; MaxIterations = 20000; MaxIterationSinceBestResult = 1500; MaxExecutionTime = 100; }
public Roteiro(IRouteService routeService, string name, string endereco, DateTime saida, DateTime volta) { _routeService = routeService; DataSaida = saida; DataVolta = volta; Load(name, endereco).Wait(); }
public void Test_With_Sample_Json() { var client = new HttpClient(_server); IRouteService routeService = (IRouteService) new DependencyResolverBuilder().DependencyResolverWebAPI.GetService(typeof(IRouteService)); var model = new RouteViewModel { AddressSearch = new List <AddressSearch>() { new AddressSearch("Avenida Paulista", 1000, "São Paulo", "SP"), new AddressSearch("Avenida Paulista", 2000, "São Paulo", "SP") }, RouteType = RouteType.DefaultRouteFaster }; var json = JsonConvert.SerializeObject(model); var request = CreateRequest("api/Route", "application/json", HttpMethod.Get, model, new JsonMediaTypeFormatter()); using (HttpResponseMessage response = client.SendAsync(request).Result) { Assert.NotNull(response.Content); Assert.AreEqual("application/json", response.Content.Headers.ContentType.MediaType); var result = JsonConvert.DeserializeObject <Route>(response.Content.ReadAsStringAsync().Result); Assert.IsTrue(result.TotalDistance > 0); } request.Dispose(); }
public RouteServiceTests(TestFixture <Startup> fixture) { var origin = new Warehouse() { Name = "A", Id = 1 }; var destiny = new Warehouse() { Name = "D", Id = 2 }; var routesEntity = new List <RouteResponse> { new RouteResponse { Origin = origin, Destiny = destiny, Hops = 1, TotalCost = 5, TotalTime = 10 }, new RouteResponse { Origin = origin, Destiny = destiny, Hops = 2, TotalCost = 1, TotalTime = 5 }, new RouteResponse { Origin = origin, Destiny = destiny, Hops = 3, TotalCost = 10, TotalTime = 1 }, }; var shipsEntity = new List <SHIPS_TO> { new SHIPS_TO { Cost = 1, Time = 1 }, new SHIPS_TO { Cost = 2, Time = 2 }, new SHIPS_TO { Cost = 3, Time = 3 } }; Repository = new Mock <IRelationshipRepository <SHIPS_TO, Warehouse, Warehouse> >(); Repository.Setup(x => x.GetAll()) .Returns(shipsEntity); Repository.Setup(x => x.GetById(It.IsAny <int>(), It.IsAny <int>())) .Returns((int o, int d) => shipsEntity.Where(s => s.Cost == 3)); Repository.Setup(x => x.Insert(It.IsAny <SHIPS_TO>(), It.IsAny <Warehouse>(), It.IsAny <Warehouse>())) .Callback((SHIPS_TO entity, Warehouse from, Warehouse to) => shipsEntity.Add(entity)); Repository.Setup(x => x.Update(It.IsAny <SHIPS_TO>(), It.IsAny <Warehouse>(), It.IsAny <Warehouse>())) .Callback((SHIPS_TO entity, Warehouse from, Warehouse to) => shipsEntity[shipsEntity.FindIndex(x => x.Cost == entity.Cost)] = entity); Repository.Setup(x => x.Delete(It.IsAny <SHIPS_TO>(), It.IsAny <Warehouse>(), It.IsAny <Warehouse>())) .Callback((SHIPS_TO entity, Warehouse from, Warehouse to) => shipsEntity.RemoveAt(shipsEntity.FindIndex(x => x.Cost == entity.Cost && x.Time == entity.Time))); var dataContext = (DataContext)fixture.Server.Host.Services.GetService(typeof(DataContext)); var routeSetup = new RouteSetup("2", "20"); var mapper = (IMapper)fixture.Server.Host.Services.GetService(typeof(IMapper)); Service = new RouteService(dataContext, routeSetup, Repository.Object, mapper); }
public AdminController(IStationService stationservice, IRouteService routeService, ITrainService trainservice, ICarriageService carriageservice, IRouteStationService routeStationService) { _stationService = stationservice; _trainService = trainservice; _carriageService = carriageservice; _routeService = routeService; _routeStationService = routeStationService; }
private static ProcessedConfig ProcessConfig(SaltarelleConfig config, IRouteService routes) { ProcessedConfig result; if (_configsCache.TryGetValue(config, out result)) return result; result = new ProcessedConfig(config, routes); _configsCache[config] = result; return result; }
public ProbabilityMatrix(IPheromoneMatrix pheromoneMatrix, IRouteService routeService, IObjectiveFunction objectiveFunction, IRandomNumberGenerator randomNumberGenerator, IRouteStatisticsService routeStatisticsService) { _routeService = routeService; _objectiveFunction = objectiveFunction; _randomNumberGenerator = randomNumberGenerator; _routeStatisticsService = routeStatisticsService; PheromoneMatrix = pheromoneMatrix; }
public SignatureService(EveVoidContext context, ISolarSystemService solarSystemService, IRouteService routeService) { _context = context; _solarSystemService = solarSystemService; _routeService = routeService; }
public RouteController(IRouteService routeService, ILocationService locationService, IVehicleService vehicleService, IAgentService agentService, IConstService constService, IMapper mapper) : base(mapper) { _routeService = routeService; _locationService = locationService; _vehicleService = vehicleService; _agentService = agentService; _constService = constService; }
public RouteNotificationController( INotificationService notificationService, IRouteService routeService, IAuthorizationService authorizationService) : base(authorizationService) { NotificationService = notificationService; RouteService = routeService; }
public RouteServiceTests() { IHttpClientWrapper httpClientWrapper = new HttpClientWrapper(); ISwaggerWrapper swaggerWrapper = new SwaggerWrapper(httpClientWrapper); IAirlineService airlineService = new AirlineService(swaggerWrapper); _routeService = new RouteService(swaggerWrapper, airlineService); }
public RaterService(IAuthorizeService auth, IAtomEntryRepository repo, ILogService logger, IRouteService router) { AuthorizeService = auth; AtomEntryRepository = repo; LogService = logger; RouteService = router; }
public TerminalController(ITerminalService terminalSvc, IRouteService routeSvc, IUserService userManagerSvc, IServiceHelper serviceHelper) { _terminalSvc = terminalSvc; _routeSvc = routeSvc; _userManagerSvc = userManagerSvc; _serviceHelper = serviceHelper; }
public RoutesController(ITownService towns, IRouteService routes, ITicketService tickets, ICompanyService companies, UserManager <User> userManager) : base(towns) { this.routes = routes; this.tickets = tickets; this.userManager = userManager; this.companies = companies; }
public RouteController(IRouteService routeService, ILogService logService, ISystemConfigurationService systemConfigurationService, IRouteViewSpotService routeViewSpotService) { _routeService = routeService; _routeViewSpotService = routeViewSpotService; _logService = logService; _systemConfigurationService = systemConfigurationService; }
public FlightModel(IFlightService services, IFlightVMService serviceVM, IUnitOfWork unitofwork, IPlaneService servicesPlane, IRouteService routeServices) { _unitofwork = unitofwork; _services = services; _planeServices = servicesPlane; _routeServices = routeServices; _serviceVM = serviceVM; }
private static ICrossover Decide(CrossoverEnum option, GASettings settings, IRouteService service) { switch (option) { case CrossoverEnum.SubRouteInsertion: return(new SubRouteInsertionCrossover(settings, RandomSingleton.Instance, service)); } throw new Exception("No crossover selected"); }
public CustomEndpointRoutingUrlHelper( ActionContext actionContext, LinkGenerator linkGenerator, IRouteService routeService) : base(actionContext) { _linkGenerator = linkGenerator ?? throw new ArgumentNullException(nameof(linkGenerator)); _routeService = routeService ?? throw new ArgumentNullException(nameof(routeService)); }
public RoutesController(IRouteService routeService, UserManager <User> userManager, ILogger <RoutesController> logger) : base(userManager) { this.logger = logger; this.routeService = routeService; this.CurrentController = this.GetType().Name; }
public RoutesController(ISegmentService segmentService, IRouteService routeService, ICityService cityService, IPriceService priceService, IParcelCategoryService parcelCategoryService, ApplicationDbContext context) { _segmentService = segmentService; _routeService = routeService; _cityService = cityService; this.priceService = priceService; this.parcelCategoryService = parcelCategoryService; this.context = context; }
public RouteLegService( IRouteLegRepository repository, IRouteService routeService, IAddressService addressService) : base(repository) { RouteService = routeService; AddressService = addressService; }
public AdminService(IAtomPubService atompub, IAnnotateService anno, IAuthorizeService auth, ILogService logger, IRouteService route, IThemeService themeSvc, IAppServiceRepository svcRepo) { AtomPubService = atompub; AnnotateService = anno; AuthorizeService = auth; RouteService = route; LogService = logger; ThemeService = themeSvc; AppServiceRepository = svcRepo; atompub.SettingEntryLinks += (e) => SetLinks(e); }
public ProcessedConfig(SaltarelleConfig cfg, IRouteService routes) { if (cfg.Scripts == null) { // Default DebugScripts = true; AddScriptsBeforeCoreScripts = new List<string>().AsReadOnly(); AddScriptsBeforeAssemblyScripts = new List<string>().AsReadOnly(); AddScriptsAfterAssemblyScripts = new List<string>().AsReadOnly(); return; } DebugScripts = cfg.Scripts.Debug; var allScripts = cfg.Scripts.Select(elem => { string url; if (!string.IsNullOrEmpty(elem.Assembly)) { if (string.IsNullOrEmpty(elem.Resource)) throw new ConfigurationErrorsException("Saltarelle configuration: if an assembly is specified for a script, the resource name must also be specified."); if (!string.IsNullOrEmpty(elem.Url)) throw new ConfigurationErrorsException("Saltarelle configuration: if an assembly is specified for a script, the URL may not also be specified."); Assembly asm; try { asm = Assembly.Load(elem.Assembly); } catch (Exception ex) { throw new ConfigurationErrorsException("Saltarelle configuration: The assembly '" + elem.Assembly + "' could not be loaded.", ex); } var res = asm.GetCustomAttributes(typeof(WebResourceAttribute), false).Cast<WebResourceAttribute>().SingleOrDefault(x => x.PublicResourceName == elem.Resource); if (res == null) throw new ConfigurationErrorsException("Saltarelle configuration: The assembly '" + elem.Assembly + "' does not contain a resource named '" + elem.Resource + "'."); url = routes.GetAssemblyResourceUrl(asm, res.PublicResourceName); } else if (!string.IsNullOrEmpty(elem.Url)) { if (VirtualPathUtility.IsAppRelative(elem.Url)) url = VirtualPathUtility.ToAbsolute(elem.Url); else url = elem.Url; } else throw new ConfigurationErrorsException("Saltarelle configuration: script elements must have assembly/resource or url specified."); return new { elem.Position, Url = url }; }).ToList(); AddScriptsBeforeCoreScripts = (from x in allScripts where x.Position == ScriptPosition.BeforeCoreScripts select x.Url).ToList().AsReadOnly(); AddScriptsBeforeAssemblyScripts = (from x in allScripts where x.Position == ScriptPosition.BeforeAssemblyScripts select x.Url).ToList().AsReadOnly(); AddScriptsAfterAssemblyScripts = (from x in allScripts where x.Position == ScriptPosition.AfterAssemblyScripts select x.Url).ToList().AsReadOnly(); }
public CalculateTotalOfRouteService(IRouteService routeService, IAddressFinderService addressFinderService) { _routeService = routeService; _addressFinderService = addressFinderService; }
public RouteController(IAccountService accountService, IRouteService routeService, IFavouriteService favouriteService) : base(accountService) { _routeService = routeService; _favouriteService = favouriteService; }
public DefaultSaltarelleUIService(IRouteService routes) { blankImageUrl = routes.GetAssemblyResourceUrl(typeof(Saltarelle.UI.Resources).Assembly, Saltarelle.UI.Resources.BlankImage); }
public CmsPageRoute(IRouteService routeService) { this.routeService = routeService; this.SetCmsRoutes(); }
public void InitializeContext() { repositoryMock = A.Fake<IVertexRepository>(); service = new RouteService(repositoryMock, new DijkstraRouteFinder()); }
public RouteServicesController() { routeService = new RouteServiceClient("BasicHttpBinding_IRouteService"); }
public RouteMapper(IRouteService routeService) { _routeService = routeService; }
public RouteReviewController(IAccountService accountService, IRouteService routeService, IRouteReviewService routeReviewService) : base(accountService) { _routeService = routeService; _routeReviewService = routeReviewService; }
/// <summary> /// Ctor. /// </summary> /// <param name="countryService"></param> /// <param name="areaService"></param> /// <param name="summitGroupService"></param> /// <param name="summitService"></param> /// <param name="routeService"></param> /// <param name="variationService"></param> /// <param name="logEntryService"></param> /// <param name="nameInputViewCommand"></param> /// <param name="difficultyManagementViewCommand"></param> /// <param name="nameAndLevelInputViewCommand"></param> /// <param name="logEntryInputViewCommand"></param> public MainViewModel(ICountryService countryService, IAreaService areaService, ISummitGroupService summitGroupService, ISummitService summitService, IRouteService routeService, IVariationService variationService, ILogEntryService logEntryService, IDifficultyLevelService difficultyLevelService, IDifficultyLevelScaleService difficultyLevelScaleService, NameInputViewCommand nameInputViewCommand, DifficultyManagementViewCommand difficultyManagementViewCommand, NameAndLevelInputViewCommand nameAndLevelInputViewCommand , LogEntryInputViewCommand logEntryInputViewCommand) { _countryService = countryService; _areaService = areaService; _summitGroupService = summitGroupService; _summitService = summitService; _routeService = routeService; _variationService = variationService; _logEntryService = logEntryService; _difficultyLevelService = difficultyLevelService; _difficultyLevelScaleService = difficultyLevelScaleService; _nameInputViewCommand = nameInputViewCommand; _difficultyManagementViewCommand = difficultyManagementViewCommand; _nameAndLevelInputViewCommand = nameAndLevelInputViewCommand; _logEntryInputViewCommand = logEntryInputViewCommand; }
public PostService(Lazy<IRepository<PostRecord>> repository, ICommentService commentService, IRouteService routeService) { _repository = repository; _commentService = commentService; _routeService = routeService; }
public RouteController(IRouteService routeService) { _routeService = routeService; }
public RouteServicesController(IRouteService _routeService) { routeService = _routeService; }
public DefaultScriptManagerService(IRouteService routes, IModuleUtils moduleUtils, SaltarelleConfig config) { this.routes = routes; this.moduleUtils = moduleUtils; var pc = ProcessConfig(config, routes); earlyAdditionalIncludes.AddRange(pc.AddScriptsBeforeCoreScripts); earlyAdditionalIncludes.AddRange((pc.DebugScripts ? Resources.CoreScriptsDebug : Resources.CoreScriptsRelease).Select(s => routes.GetAssemblyResourceUrl(typeof(Resources).Assembly, s))); earlyAdditionalIncludes.AddRange(pc.AddScriptsBeforeAssemblyScripts); lateAdditionalIncludes.AddRange(pc.AddScriptsAfterAssemblyScripts); }
public ModuleUtils(IRouteService routes) { this.routes = routes; }
public RouteController(IRouteMapper mapper, IRouteService routeService) { _mapper = mapper; }
public SubscribeController( IRouteService routeService) { this.routeService = routeService; }
public RouteController(IRouteService routeService, IUserService userService) { this.routeService = routeService; this.userService = userService; }
public DefaultLesson7Provider(IContainer container, IScriptManagerService scriptManager, IRouteService routes) { _container = container; _scriptManager = scriptManager; _routes = routes; }
public void InitialSetup() { userRepository = new Mock<IUserRepository>(); mailService = new Mock<IMailService>(); routeRepository = new Mock<IRouteRepository>(); userService = new UserService(userRepository.Object, mailService.Object); routeService = new RouteService(routeRepository.Object, userRepository.Object); }
public async void Should_Throw_An_Exception_If_The_Token_Is_Invalid() { var mockToken = new Mock<IToken>(); mockToken.Setup(x => x.Tokenvalue).Returns(string.Empty); _routeService = new RouteService(new MapLinkCoordinateFinder(mockToken.Object), _mockRouteCalculator.Object); var address1 = new AddressSearch("Avenida Paulista", 1000, "São Paulo", "SP"); var list = new List<AddressSearch>() { address1 }; await _routeService.CalculateRouteAsync(list, RouteType.DefaultRouteFaster); }
public AdminController(IUserService userService, IRouteService routeService) { this.userService = userService; this.routeService = routeService; }