Beispiel #1
0
        public Voyage(Guid id, int capacity, DateTime departuredate, DateTime arrivalDate)
            : base(id)
        {
            var e = new VoyageCreatedEvent(id, capacity, 0, capacity, departuredate, arrivalDate);

            ApplyEvent(e);
        }
Beispiel #2
0
 protected void OnVoyageCreated(VoyageCreatedEvent e)
 {
     _capacity = e.Capacity;
     _capacityUsed = e.CapacityUsed;
     _capacityLeft = e.CapacityLeft;
     _departureDate = e.DepartureDate;
     _arrivalDate = e.ArrivalDate;
 }
Beispiel #3
0
        public Voyage(Guid id, float capacity, DateTime departuredate, DateTime arrivalDate)
            : base(id)
        {
            GuardThatArrivalDateIsAfterDeparturetDate(departuredate, arrivalDate);

            const float overbooking = 1.1f;
            var e = new VoyageCreatedEvent(id, capacity, 0, capacity, departuredate, arrivalDate, capacity * overbooking);

            ApplyEvent(e);
        }
Beispiel #4
0
        public Voyage(Guid id, float capacity, DateTime departuredate, DateTime arrivalDate)
            : base(id)
        {
            // Opdracht 2b
            // Roep een nieuwe methode GuardThatArrivalDateIsAfterDeparturetDate aan die controleert of arrival date na departure date ligt.
            // Zo niet, dan wordt er een ArrivalDateBeforeDepartureDateException gegooid

            const float overbooking = 1.1f;
            var e = new VoyageCreatedEvent(id, capacity, 0, capacity, departuredate, arrivalDate, capacity * overbooking);

            ApplyEvent(e);
        }