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); }
public void Apply(AppointmentCanceled @event) { CancellationReason = @event.CancellationReason; State = @event.State; }