Exemplo n.º 1
0
        public void CreateBooked_ServiceDateNotFromTheFuture_BreaksDateMustBeFromTheFutureRule(DateTime date)
        {
            Func <Booking.Domain.Bookings.Booking> act = () => BookingFactory.CreateBooked(date, 60);

            var result = Assert.Throws <BusinessRuleValidationException>(act);

            Assert.IsType <DateMustBeFromTheFutureRule>(result.Rule);
        }
Exemplo n.º 2
0
        public void ChangeRecordStatus_FinishedAllBookedRecords_IsFinished(BookedRecordStatus serviceStatus)
        {
            var booking   = BookingFactory.CreateBooked(DateTime.Now.AddDays(1), 60);
            var serviceId = booking.DomainEvents.OfType <BookedEvent>().Single().BookedRecordId;

            booking.ChangeRecordStatus(serviceId, serviceStatus);

            Assert.True(booking.IsFinished);
            AssertDomainEventPublished <BookingFinishedEvent>(booking);
        }
Exemplo n.º 3
0
        public void CreateBooked_DateFromTheFuture_IsSuccess(DateTime date)
        {
            var booking = BookingFactory.CreateBooked(date, 60);

            AssertDomainEventPublished <BookedEvent>(booking);
        }