createHandlingEvent() public method

Creates a handling event.
if there's no voyage with this number if there's no cargo with this tracking id if there's no location with this UN Locode
public createHandlingEvent ( System.DateTime completionTime, TrackingId trackingId, VoyageNumber voyageNumber, UnLocode unlocode, HandlingActivityType type, OperatorCode operatorCode ) : HandlingEvent
completionTime System.DateTime when the event was completed, for example finished loading
trackingId TrackingId cargo tracking id
voyageNumber VoyageNumber voyage number
unlocode UnLocode United Nations Location Code for the location of the event
type HandlingActivityType type of event
operatorCode OperatorCode operator code
return HandlingEvent
        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;
        }