public void SetUp()
        {
            routingService = new RoutingServiceImpl();

            applicationEvents = new SynchronousApplicationEventsStub();

            // In-memory implementations of the repositories
            handlingEventRepository = new HandlingEventRepositoryInMem();
            cargoRepository = new CargoRepositoryInMem();
            locationRepository = new LocationRepositoryInMem();
            voyageRepository = new VoyageRepositoryInMem();

            // Actual factories and application services, wired with stubbed or in-memory infrastructure
            handlingEventFactory = new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository);

            cargoInspectionService = new CargoInspectionService(applicationEvents, cargoRepository,
                                                                handlingEventRepository);
            handlingEventService = new HandlingEventService(handlingEventRepository, applicationEvents,
                                                            handlingEventFactory);
            bookingService = new BookingService(cargoRepository, locationRepository, routingService);

            // Circular dependency when doing synchrounous calls
            ((SynchronousApplicationEventsStub) applicationEvents).SetCargoInspectionService(cargoInspectionService);
        }
Beispiel #2
0
        public void SetUp()
        {
            routingService = new RoutingServiceImpl();

            applicationEvents = new SynchronousApplicationEventsStub();

            // In-memory implementations of the repositories
            handlingEventRepository = new HandlingEventRepositoryInMem();
            cargoRepository         = new CargoRepositoryInMem();
            locationRepository      = new LocationRepositoryInMem();
            voyageRepository        = new VoyageRepositoryInMem();

            // Actual factories and application services, wired with stubbed or in-memory infrastructure
            handlingEventFactory = new HandlingEventFactory(cargoRepository, voyageRepository, locationRepository);

            cargoInspectionService = new CargoInspectionService(applicationEvents, cargoRepository,
                                                                handlingEventRepository);
            handlingEventService = new HandlingEventService(handlingEventRepository, applicationEvents,
                                                            handlingEventFactory);
            bookingService = new BookingService(cargoRepository, locationRepository, routingService);

            // Circular dependency when doing synchrounous calls
            ((SynchronousApplicationEventsStub)applicationEvents).SetCargoInspectionService(cargoInspectionService);
        }