コード例 #1
0
 public void testSetSchedule() throws Exception {
   TimeScheduleEditor editor = new TimeScheduleEditor(shell);
   editor.setSchedule(
       new MarketTime[] {
         new MarketTime(getTime(9, 0), getTime(16, 0)),
       });
   assertEquals(1, editor.getViewer().getTable().getItemCount());
 }
コード例 #2
0
 public void testEditDescription() throws Exception {
   TimeScheduleEditor editor = new TimeScheduleEditor(shell);
   editor.setSchedule(
       new MarketTime[] {
         new MarketTime(getTime(9, 0), getTime(16, 0)),
       });
   MarketTimeElement element =
       (MarketTimeElement) editor.getViewer().getTable().getItem(0).getData();
   ICellModifier cellModifier = editor.getViewer().getCellModifier();
   assertTrue(cellModifier.canModify(element, "2"));
   assertEquals("", cellModifier.getValue(element, "2"));
   cellModifier.modify(element, "2", "New Description");
   assertEquals("New Description", element.getDescription());
 }
コード例 #3
0
 public void testSetScheduleInProperOrder() throws Exception {
   TimeScheduleEditor editor = new TimeScheduleEditor(shell);
   MarketTime[] schedule =
       new MarketTime[] {
         new MarketTime(getTime(18, 0), getTime(20, 0)),
         new MarketTime(getTime(9, 0), getTime(16, 0)),
       };
   editor.setSchedule(schedule);
   assertEquals(
       schedule[1].getOpenTime(),
       ((MarketTimeElement) editor.getViewer().getTable().getItem(0).getData()).getOpenTime());
   assertEquals(
       schedule[0].getOpenTime(),
       ((MarketTimeElement) editor.getViewer().getTable().getItem(1).getData()).getOpenTime());
 }