protected function createInstance()
 {
     return new ActivityRescheduled(ActivityId::generate(), Schedule::forPeriod(new DateTimeImmutable('2015-10-03 14:30'), new DateTimeImmutable('2015-10-03 15:30')));
 }
 /** @test */
 public function an_activity_isnt_rescheduled_when_the_same_period_is_given()
 {
     $id = ActivityId::generate();
     $this->scenario->withAggregateId($id)->given([$this->socialActivityWasPlanned($id, ['schedule' => Schedule::forPeriod(new DateTimeImmutable('2015-10-03 14:30'), new DateTimeImmutable('2015-10-03 15:30'))])])->when(function ($activity) {
         return $activity->reschedule(Schedule::forPeriod(new DateTimeImmutable('2015-10-03 14:30'), new DateTimeImmutable('2015-10-03 15:30')));
     })->then([]);
     // It should also be idempotent when repeatedly rescheduling an activity
     $this->scenario->withAggregateId($id)->given([$this->socialActivityWasPlanned($id), new ActivityRescheduled($id, Schedule::forPeriod(new DateTimeImmutable('2015-10-03 14:30'), new DateTimeImmutable('2015-10-03 15:30')))])->when(function ($activity) {
         return $activity->reschedule(Schedule::forPeriod(new DateTimeImmutable('2015-10-03 14:30'), new DateTimeImmutable('2015-10-03 15:30')));
     })->then([]);
 }
 protected function createInstance()
 {
     return new ActivityPlanned(ActivityId::generate(), 'Crash & Compile', 'Programming competition', Schedule::withStartTime(new DateTimeImmutable('2015-10-01 14:30')), Location::fromNameAndAddress('Francken kamer'), Activity::SOCIAL);
 }
 protected function createInstance()
 {
     return new ActivityCategorized(ActivityId::generate(), Activity::EDUCATION);
 }
 protected function createInstance()
 {
     return new MemberRegisteredToParticipate(ActivityId::generate(), MemberId::generate());
 }
 protected function createInstance()
 {
     return new ActivityPublished(ActivityId::generate());
 }