Пример #1
0
 public function testBlackoutListItemCreatesBlackoutSlot()
 {
     $view = new TestBlackoutItemView(1, Date::Parse('2011-11-22 04:34'), Date::Parse('2011-11-23 14:43'), 123);
     $item = new BlackoutListItem($view);
     $this->assertEquals($view->StartDate, $item->StartDate());
     $this->assertEquals($view->EndDate, $item->EndDate());
     $this->assertEquals($view->ResourceId, $item->ResourceId());
     $start = Date::Parse('2011-12-01');
     $end = Date::Parse('2011-12-02');
     $period = new SchedulePeriod($start, $end);
     $display = Date::Parse('2011-12-03');
     $span = 3;
     $expectedSlot = new BlackoutSlot($period, $period, $display, $span, $view);
     $actualSlot = $item->BuildSlot($period, $period, $display, $span);
     $this->assertEquals($expectedSlot, $actualSlot);
 }
Пример #2
0
 public function __construct(Date $start, Date $end, $resourceId)
 {
     $this->start = $start;
     $this->end = $end;
     $this->resourceId = $resourceId;
     parent::__construct(new TestBlackoutItemView(1, $start, $end, $resourceId));
 }