to have accurate availability value for a parking lot, occupancy must be updated every time a driver enters a parking lot Scenario: Entering with First Come First Serve access type Given "Brussels Nord" parking lot has 53 available spots When a car enters "Brussels Nord" parking lot using "FCFS" access Then there are 52 available spots in "Brussels Nord" parking lot 1 2 3 4 5 6 7 8
When a car enters "Brussels Nord" parking lot using "FCFS" access 2 Then there are 52 available spots in "Brussels Nord" parking lot 3 /** * @Given :arg1 parking lot has :arg2 available spots * @param mixed $arg1 * @param mixed $arg2 */ public function parkingLotHasAvailableSpots($arg1, $arg2) { throw new PendingException(); } 1 2 3 4 5 6 7 8 9
When a car enters "Brussels Nord" parking lot using "FCFS" access 2 Then there are 52 available spots in "Brussels Nord" parking lot 3 /** * @Given :arg1 parking lot has :arg2 available spots * @param mixed $arg1 * @param mixed $arg2 */ public function parkingLotHasAvailableSpots($arg1, $arg2) { $parkingLot = new ParkingLot($arg1,$arg2); $this->parkingLots->save($parkingLot); } 1 2 3 4 5 6 7 8 9 10
access Given "Brussels Nord" parking lot has 53 available spots 1 2 Then there are 52 available spots in "Brussels Nord" parking lot 3 /** * @When a car enters :arg1 parking lot using :arg2 access */ public function aCarEntersParkingLotUsingAccess($arg1, $arg2) { throw new PendingException(); } 1 2 3 4 5 6 7
access Given "Brussels Nord" parking lot has 53 available spots 1 2 Then there are 52 available spots in "Brussels Nord" parking lot 3 /** * @When a car enters :arg1 parking lot using :arg2 access */ public function aCarEntersParkingLotUsingAccess($arg1, $arg2) { $this->bus->dispatch(new EnterParkingLot($arg1,$arg2))); } 1 2 3 4 5 6 7
lot Given "Brussels Nord" parking lot has 53 available spots 1 When a car enters "Brussels Nord" parking lot using "FCFS" access 2 3 /** * @Then there are :arg2 available spots in :arg1 parking lot */ public function thereAreAvailableSpotsInParkingLot2($arg1, $arg2) { throw new PendingException(); } 1 2 3 4 5 6 7
lot Given "Brussels Nord" parking lot has 53 available spots 1 When a car enters "Brussels Nord" parking lot using "FCFS" access 2 3 /** * @Then there are :arg2 available spots in :arg1 parking lot */ public function thereAreAvailableSpotsInParkingLot($arg1, $arg2) { $parkingLot = $this->parkingLots->findByName($arg2); Assert::equals($arg1, $parkingLot->capacity()); } 1 2 3 4 5 6 7 8