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); }
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); }
public void CreateBooked_DateFromTheFuture_IsSuccess(DateTime date) { var booking = BookingFactory.CreateBooked(date, 60); AssertDomainEventPublished <BookedEvent>(booking); }