public void should_set_cancellation_reason_correctly()
        {
            var fixture = new Fixture();
            var sut     = fixture.Create <Appointment>();

            var @event = new AppointmentCanceled(sut.Id, "i went somewhere else");

            sut.Apply(@event);

            sut.CancellationReason.Should().Be(@event.CancellationReason);
        }
        public void should_update_state_to_canceled()
        {
            var fixture = new Fixture();
            var sut     = fixture.Create <Appointment>();

            var @event = new AppointmentCanceled(sut.Id, "i went somewhere else");

            sut.Apply(@event);

            sut.State.Should().Be(AppointmentState.Canceled);
        }
Beispiel #3
0
 public void Apply(AppointmentCanceled @event)
 {
     CancellationReason = @event.CancellationReason;
     State = @event.State;
 }