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 ExternalRoutingService(GraphTraversalService graphTraversalService,
                               LocationRepository locationRepository,
                               VoyageRepository voyageRepository)
 {
     this.graphTraversalService = graphTraversalService;
     this.locationRepository = locationRepository;
     this.voyageRepository = voyageRepository;
 }
 public ExternalRoutingService(GraphTraversalService graphTraversalService,
                               LocationRepository locationRepository,
                               VoyageRepository voyageRepository)
 {
     this.graphTraversalService = graphTraversalService;
     this.locationRepository    = locationRepository;
     this.voyageRepository      = voyageRepository;
 }
Exemplo n.º 4
0
        public void SetUp()
        {
            ILocationRepository locationRepository = new LocationRepositoryInMem();

            voyageRepositoryMock = new Mock<IVoyageRepository>();
            voyageRepository = voyageRepositoryMock.Object;
            var daoTest = new Mock<GraphDAO>();
            daoTest.CallBase = true;
            daoTest.Setup(d => d.ListLocations()).Returns(new List<string>()
                                                              {
                                                                  SampleLocations.TOKYO.UnLocode.IdString,
                                                                  SampleLocations.STOCKHOLM.UnLocode.IdString,
                                                                  SampleLocations.GOTHENBURG.UnLocode.IdString
                                                              });

            IGraphTraversalService graphTraversalService = new GraphTraversalService(daoTest.Object);

            externalRoutingService = new ExternalRoutingService(graphTraversalService, locationRepository,
                                                                voyageRepository);
        }
        public void SetUp()
        {
            ILocationRepository locationRepository = new LocationRepositoryInMem();

            voyageRepositoryMock = new Mock <IVoyageRepository>();
            voyageRepository     = voyageRepositoryMock.Object;
            var daoTest = new Mock <GraphDAO>();

            daoTest.CallBase = true;
            daoTest.Setup(d => d.ListLocations()).Returns(new List <string>()
            {
                SampleLocations.TOKYO.UnLocode.IdString,
                SampleLocations.STOCKHOLM.UnLocode.IdString,
                SampleLocations.GOTHENBURG.UnLocode.IdString
            });


            IGraphTraversalService graphTraversalService = new GraphTraversalService(daoTest.Object);

            externalRoutingService = new ExternalRoutingService(graphTraversalService, locationRepository,
                                                                voyageRepository);
        }
Exemplo n.º 6
0
 public RoutingFacade(GraphTraversalService graphTraversalService)
 {
     _graphTravesrsalService = graphTraversalService;
 }
Exemplo n.º 7
0
 public RoutingService(ILocationRepository locatinRepository, GraphTraversalService graphTraversalService)
 {
     _locatinRepository     = locatinRepository;
     _graphTraversalService = graphTraversalService;
 }