public function testReturnsAllAccessoriesReservedWithinDateRange() { $dateRange = new TestDateRange(); $refNum = "213213213"; $start = Date::Now(); $end = Date::Now(); $accessoryName = 'accessory'; $accessoryId = 123; $quantity = 898; $rows[] = $this->GetAccessoryRow($refNum, $start, $end, $accessoryName, $accessoryId, $quantity); $rows[] = $this->GetAccessoryRow("1", Date::Now(), Date::Now(), "", 1, 1); $this->db->SetRows($rows); $getAccessoriesCommand = new GetAccessoryListCommand($dateRange->GetBegin(), $dateRange->GetEnd()); $accessories = $this->repository->GetAccessoriesWithin($dateRange); $a = new AccessoryReservation($refNum, $start->ToUtc(), $end->ToUtc(), $accessoryId, $quantity, $accessoryName); $this->assertEquals($getAccessoriesCommand, $this->db->_LastCommand); $this->assertEquals(2, count($accessories)); $this->assertEquals($a, $accessories[0]); }