예제 #1
0
파일: RoomTest.php 프로젝트: madal3x/evso
 public function testCreate()
 {
     $id = new UUID();
     $name = 'testRoom';
     $seatCapacity = 2;
     $room = Room::create($id, $name, $seatCapacity);
     $this->roomRepositoryWithExpectedEvents($room->uncommittedEvents())->save($room, 0);
     $this->assertEquals($name, $room->name());
     $this->assertEquals($seatCapacity, $room->seatCapacity());
     $this->assertEquals(0, $room->bookedCapacity());
     return $room;
 }
예제 #2
0
 public function handle(CreateRoomCommand $command)
 {
     $room = Room::create(new UUID($command->roomId()), $command->name(), $command->seatCapacity());
     $this->repository->save($room, $command->aggregateVersion());
 }