protected void setUp() { LocationRepository locationRepository = new LocationRepositoryInMem(); voyageRepository = MockRepository.GenerateMock <VoyageRepository>(); GraphTraversalService graphTraversalService = MockRepository.GenerateMock <GraphTraversalService>(); graphTraversalService.Expect(s => s.findShortestPath( Arg <string> .Is.TypeOf, Arg <string> .Is.TypeOf, Arg <Hashtable> .Is.TypeOf)).Return(new List <TransitPath>()); graphTraversalService.Replay(); // TODO expectations on GTS externalRoutingService = new ExternalRoutingService(graphTraversalService, locationRepository, voyageRepository); /*new GraphTraversalServiceImpl(new GraphDAO() { * public List<String> listLocations() { * return Arrays.asList(TOKYO.unLocode().stringValue(), STOCKHOLM.unLocode().stringValue(), GOTHENBURG.unLocode().stringValue()); * } * * public void storeCarrierMovementId(String cmId, String from, String to) { * } * });*/ }
protected void setUp() { LocationRepository locationRepository = new LocationRepositoryInMem(); voyageRepository = MockRepository.GenerateMock<VoyageRepository>(); GraphTraversalService graphTraversalService = MockRepository.GenerateMock<GraphTraversalService>(); graphTraversalService.Expect(s => s.findShortestPath( Arg<string>.Is.TypeOf, Arg<string>.Is.TypeOf, Arg<Hashtable>.Is.TypeOf)).Return(new List<TransitPath>()); graphTraversalService.Replay(); // TODO expectations on GTS externalRoutingService = new ExternalRoutingService(graphTraversalService, locationRepository, voyageRepository); /*new GraphTraversalServiceImpl(new GraphDAO() { public List<String> listLocations() { return Arrays.asList(TOKYO.unLocode().stringValue(), STOCKHOLM.unLocode().stringValue(), GOTHENBURG.unLocode().stringValue()); } public void storeCarrierMovementId(String cmId, String from, String to) { } });*/ }
public HandlingEventFactory(CargoRepository cargoRepository, VoyageRepository voyageRepository, LocationRepository locationRepository) { this.cargoRepository = cargoRepository; this.voyageRepository = voyageRepository; this.locationRepository = locationRepository; }
public ExternalRoutingService(GraphTraversalService graphTraversalService, LocationRepository locationRepository, VoyageRepository voyageRepository) { this.graphTraversalService = graphTraversalService; this.locationRepository = locationRepository; this.voyageRepository = voyageRepository; }
public BookingServiceFacadeImpl(BookingService bookingService, LocationRepository locationRepository, CargoRepository cargoRepository, VoyageRepository voyageRepository) { this.bookingService = bookingService; this.locationRepository = locationRepository; this.cargoRepository = cargoRepository; this.voyageRepository = voyageRepository; }
public void setUp() { systemEvents = MockRepository.GenerateMock<SystemEvents>(); cargoRepository = new CargoRepositoryInMem(); handlingEventRepository = new HandlingEventRepositoryInMem(); locationRepository = new LocationRepositoryInMem(); voyageRepository = new VoyageRepositoryInMem(); trackingIdFactory = new TrackingIdFactoryInMem(); handlingEventFactory = new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository); cargoUpdater = new CargoUpdater(systemEvents, cargoRepository, handlingEventRepository); }
protected void setUp() { cargoRepository = MockRepository.GenerateMock<CargoRepository>(); voyageRepository = new VoyageRepositoryInMem(); locationRepository = new LocationRepositoryInMem(); factory = new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository); trackingId = new TrackingId("ABC"); RouteSpecification routeSpecification = new RouteSpecification(L.TOKYO, L.HELSINKI, DateTime.Now); cargo = new Cargo(trackingId, routeSpecification); }
public void setUp() { systemEvents = MockRepository.GenerateMock <SystemEvents>(); cargoRepository = new CargoRepositoryInMem(); handlingEventRepository = new HandlingEventRepositoryInMem(); locationRepository = new LocationRepositoryInMem(); voyageRepository = new VoyageRepositoryInMem(); trackingIdFactory = new TrackingIdFactoryInMem(); handlingEventFactory = new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository); cargoUpdater = new CargoUpdater(systemEvents, cargoRepository, handlingEventRepository); }
protected void setUp() { cargoRepository = MockRepository.GenerateMock <CargoRepository>(); voyageRepository = new VoyageRepositoryInMem(); locationRepository = new LocationRepositoryInMem(); factory = new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository); trackingId = new TrackingId("ABC"); RouteSpecification routeSpecification = new RouteSpecification(L.TOKYO, L.HELSINKI, DateTime.Now); cargo = new Cargo(trackingId, routeSpecification); }
protected void setUp() { cargoRepository = MockRepository.GenerateMock<CargoRepository>(); voyageRepository = MockRepository.GenerateMock<VoyageRepository>(); handlingEventRepository = MockRepository.GenerateMock<HandlingEventRepository>(); locationRepository = MockRepository.GenerateMock<LocationRepository>(); systemEvents = MockRepository.GenerateMock<SystemEvents>(); HandlingEventFactory handlingEventFactory = new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository); service = new HandlingEventServiceImpl(handlingEventRepository, systemEvents, handlingEventFactory); }
protected void setUp() { cargoRepository = MockRepository.GenerateMock <CargoRepository>(); voyageRepository = MockRepository.GenerateMock <VoyageRepository>(); handlingEventRepository = MockRepository.GenerateMock <HandlingEventRepository>(); locationRepository = MockRepository.GenerateMock <LocationRepository>(); systemEvents = MockRepository.GenerateMock <SystemEvents>(); HandlingEventFactory handlingEventFactory = new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository); service = new HandlingEventServiceImpl(handlingEventRepository, systemEvents, handlingEventFactory); }
internal static Itinerary fromDTO(RouteCandidateDTO routeCandidateDTO, VoyageRepository voyageRepository, LocationRepository locationRepository) { var legs = new List<Leg>(routeCandidateDTO.getLegs().Count()); foreach(LegDTO legDTO in routeCandidateDTO.getLegs()) { var voyageNumber = new VoyageNumber(legDTO.getVoyageNumber()); var voyage = voyageRepository.find(voyageNumber); var from = locationRepository.find(new UnLocode(legDTO.getFrom())); var to = locationRepository.find(new UnLocode(legDTO.getTo())); legs.Add(Leg.DeriveLeg(voyage, from, to)); } return new Itinerary(legs); }
internal static Itinerary fromDTO(RouteCandidateDTO routeCandidateDTO, VoyageRepository voyageRepository, LocationRepository locationRepository) { var legs = new List <Leg>(routeCandidateDTO.getLegs().Count()); foreach (LegDTO legDTO in routeCandidateDTO.getLegs()) { var voyageNumber = new VoyageNumber(legDTO.getVoyageNumber()); var voyage = voyageRepository.find(voyageNumber); var from = locationRepository.find(new UnLocode(legDTO.getFrom())); var to = locationRepository.find(new UnLocode(legDTO.getTo())); legs.Add(Leg.DeriveLeg(voyage, from, to)); } return(new Itinerary(legs)); }
public ItineraryUpdater(VoyageRepository voyageRepository, CargoRepository cargoRepository) { this.voyageRepository = voyageRepository; this.cargoRepository = cargoRepository; }