示例#1
0
        public CargoTests()
        {
            _stockholm = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "STOCKHOLM");
            _hambourg = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "HAMBOURG");
            _hongkong = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "HONGKONG");
            _melbourne = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "MELBOURNE");

            _voyage = new VoyageBuilder(new VoyageNumber("0123"), _stockholm)
                .AddMovement(_hambourg, DateTime.Now, DateTime.Now)
                .AddMovement(_hongkong, DateTime.Now, DateTime.Now)
                .AddMovement(_melbourne, DateTime.Now, DateTime.Now)
                .Build();
        }
        public HandlingHistoryTests()
        {
            var shanghai = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "SHANGHAI");
            var dallas = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "DALLAS");
            var hongkong = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "HONGKONG");

            _cargo = new BookingApi.Domain.Cargo.Cargo(new TrackingId("ABC"), new RouteSpecification(shanghai, dallas, new DateTime(2009, 4, 1)));
            _voyage = new VoyageBuilder(new VoyageNumber("X25"), hongkong)
                                                                        .AddMovement(shanghai, DateTime.Now, DateTime.Now)
                                                                        .AddMovement(dallas, DateTime.Now, DateTime.Now)
                                                                        .Build();

            _handlingEvent1 = new HandlingEvent(HandlingEventType.Load, shanghai, new DateTime(100), new DateTime(2009, 3, 5), _cargo, _voyage);
            _handlingEvent1Duplicate = new HandlingEvent(HandlingEventType.Load, shanghai, new DateTime(200), new DateTime(2009, 3, 5), _cargo, _voyage);
            _handlingEvent2 = new HandlingEvent(HandlingEventType.Unload, dallas, new DateTime(150), new DateTime(2009, 3, 10), _cargo, _voyage);

            _handlingHistory = new HandlingHistory(new List<HandlingEvent> {_handlingEvent2, _handlingEvent1, _handlingEvent1Duplicate});
        }
 public ItineraryTests()
 {
     _voyage = new VoyageBuilder(new VoyageNumber("0123"), _shanghai)
                                 .AddMovement(_rotterdam, DateTime.Now, DateTime.Now)
                                 .AddMovement(_gothenburg, DateTime.Now, DateTime.Now)
                                 .Build();
     _wrongVoyage = new VoyageBuilder(new VoyageNumber("666"), _newyork)
                                 .AddMovement(new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "STOCKHOLM"), DateTime.Now, DateTime.Now)
                                 .AddMovement(_helsinki, DateTime.Now, DateTime.Now)
                                 .Build();
     _trackingId = new TrackingId("CARGO1");
     _routeSpecification = new RouteSpecification(_shanghai, _gothenburg, DateTime.Now);
     _cargo = new BookingApi.Domain.Cargo.Cargo(_trackingId, _routeSpecification);
     _itinerary = new Itinerary(new List<Leg>
                                	{
                                		new Leg(_voyage, _shanghai, DateTime.Now, _rotterdam, DateTime.Now),
                                     new Leg(_voyage, _rotterdam, DateTime.Now, _gothenburg, DateTime.Now)
                                	});
 }
 public HandlingEventTests()
 {
     var trackingId = new TrackingId("XYZ");
     _hongkong = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "HONGKONG");
     _newYork = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "NEW YORK");
     _helsinki = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "HELSINKI");
     _chicago = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "CHICAGO");
     _hambourg = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "HAMBOURG");
     var routeSpecification = new RouteSpecification(_hongkong, _newYork, DateTime.Now);
     _cargo = new BookingApi.Domain.Cargo.Cargo(trackingId, routeSpecification);
     _voyage = new VoyageBuilder(new VoyageNumber("X25"), _hongkong)
                                                                 .AddMovement(_newYork, DateTime.Now, DateTime.Now)
                                                                 .Build();
     _voyage2 = new VoyageBuilder(new VoyageNumber("CM004"), _newYork)
                                                                 .AddMovement(_chicago, DateTime.Now, DateTime.Now)
                                                                 .Build();
     _voyage3 = new VoyageBuilder(new VoyageNumber("CM005"), _chicago)
                                                                 .AddMovement(_hambourg, DateTime.Now, DateTime.Now)
                                                                 .Build();
 }
示例#5
0
        public void should_equal_the_same_legs()
        {
            var loadTime = DateTime.Now;
            var unloadTime = DateTime.Now;
            var voyage = new BookingApi.Domain.Voyage.Voyage(new VoyageNumber("1235"),
                                                             new Schedule(new List<CarrierMovement>
                                                                          	{
                                                                          		new CarrierMovement(new BookingApi.Domain.Location.Location(new UnLocode("ABCDE"), "start"), new BookingApi.Domain.Location.Location(new UnLocode("BDERT"), "stop"), loadTime, unloadTime)
                                                                          	}));
            var leg = new Leg(voyage,
                                                            new BookingApi.Domain.Location.Location(new UnLocode("ABCDE"), "test-name"),
                                                            loadTime,
                                                            new BookingApi.Domain.Location.Location(new UnLocode("ERTYU"), "test-name2"),
                                                            unloadTime);
            var leg2 = new Leg(voyage,
                                                            new BookingApi.Domain.Location.Location(new UnLocode("ABCDE"), "test-name"),
                                                            loadTime,
                                                            new BookingApi.Domain.Location.Location(new UnLocode("ERTYU"), "test-name2"),
                                                            unloadTime);

            Assert.True(leg.Equals(leg2));
        }
        public DeliveryTests()
        {
            _chicago = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "CHICAGO");
            _hambourg = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "HAMBOURG");
            _gdansk = new BookingApi.Domain.Location.Location(UnLocodeHelpers.GetNewUnLocode(), "GDANSK");

            _voyage = new BookingApi.Domain.Voyage.Voyage(new VoyageNumber("CM01"), new Schedule(new List<CarrierMovement>
                                                                                                 	{
                                                                                                 		new CarrierMovement(_chicago,
                                                                                                 		                    _hambourg,
                                                                                                 		                    DateTime.
                                                                                                 		                    	Now,
                                                                                                 		                    DateTime.
                                                                                                 		                    	Now)
                                                                                                 	}));

            _voyage2 = new BookingApi.Domain.Voyage.Voyage(new VoyageNumber("CM03"), new Schedule(new List<CarrierMovement>
                                                                                                 	{
                                                                                                 		new CarrierMovement(_chicago,
                                                                                                 		                    _hambourg,
                                                                                                 		                    DateTime.
                                                                                                 		                    	Now,
                                                                                                 		                    DateTime.
                                                                                                 		                    	Now),
                                                                                                        new CarrierMovement(_hambourg,
                                                                                                 		                    _gdansk,
                                                                                                 		                    DateTime.
                                                                                                 		                    	Now,
                                                                                                 		                    DateTime.
                                                                                                 		                    	Now)
                                                                                                 	}));

            _itineraryCHtoHAM = new Itinerary(new List<Leg>
                                       					{
                                       						new Leg(_voyage,
                                                                        _chicago,
                                                                        DateTime.Now,
                                                                        _hambourg,
                                                                        DateTime.Now)
                                       					});

            _itineraryCHtoGD = new Itinerary(new List<Leg>
                                       					{
                                       						new Leg(_voyage2,
                                                                        _chicago,
                                                                        DateTime.Now,
                                                                        _hambourg,
                                                                        DateTime.Now),
                                                            new Leg(_voyage2,
                                                                        _hambourg,
                                                                        DateTime.Now,
                                                                        _gdansk,
                                                                        DateTime.Now)
                                       					});

            _itineraryHAMtoCH = new Itinerary(new List<Leg>
                                       	{
                                       		new Leg(new BookingApi.Domain.Voyage.Voyage(new VoyageNumber("CM02"), new Schedule(new List<CarrierMovement>
                                       			                                                 									{
                                       			                                                 										new CarrierMovement(_hambourg,
                                                                                                                                                            _chicago,
                                       			                                                 															DateTime.Now,
                                       			                                                 															DateTime.Now)
                                       			                                                 									})),
                                                                                                                                    _hambourg,
                                                                                                                                    DateTime.Now,
                                                                                                                                    _chicago,
                                                                                                                                    DateTime.Now)
                                       	});

            _cargo = new BookingApi.Domain.Cargo.Cargo(new TrackingId("CAR01"), new RouteSpecification(_chicago, _hambourg, DateTime.Now));
        }