Ejemplo n.º 1
0
        public void setUp()
        {
            reportSubmission = MockRepository.GenerateMock<ReportSubmission>();
            CargoRepository cargoRepository = new CargoRepositoryInMem();
            HandlingEventRepository handlingEventRepository = new HandlingEventRepositoryInMem();
            HandlingEventFactory handlingEventFactory = new HandlingEventFactory(cargoRepository,
                new VoyageRepositoryInMem(),
                new LocationRepositoryInMem());

            TrackingId trackingId = new TrackingId("ABC");
            RouteSpecification routeSpecification = new RouteSpecification(L.HONGKONG, L.ROTTERDAM, DateTime.Parse("2009-10-10"));
            Cargo cargo = new Cargo(trackingId, routeSpecification);
            cargoRepository.store(cargo);

            HandlingEvent handlingEvent = handlingEventFactory.createHandlingEvent(
                DateTime.Parse("2009-10-02"),
                trackingId,
                null,
                L.HONGKONG.UnLocode,
                HandlingActivityType.RECEIVE,
                new OperatorCode("ABCDE")
                );
            handlingEventRepository.store(handlingEvent);

            cargo.Handled(handlingEvent.Activity);

            reportPusher = new ReportPusher(reportSubmission, cargoRepository, handlingEventRepository);
            eventSequenceNumber = handlingEvent.SequenceNumber;
        }
 public HandlingEventServiceImpl(HandlingEventRepository handlingEventRepository,
                                 SystemEvents systemEvents,
                                 HandlingEventFactory handlingEventFactory)
 {
     this.handlingEventRepository = handlingEventRepository;
     this.systemEvents = systemEvents;
     this.handlingEventFactory = handlingEventFactory;
 }
Ejemplo n.º 3
0
 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);
        }