コード例 #1
0
 @Override
 protected void createCommand() {
   command = new CreateCardCommand();
   card = mock(Card.class);
   command.setModel(card);
   container = mock(CardContainer.class);
   command.setContainer(container);
   command.initialize();
 }
コード例 #2
0
 @Test
 public void initialize() throws Exception {
   CreateCardCommand command = new CreateCardCommand();
   command.initialize();
   assertThat(command.canExecute(), is(false));
   Card card = mock(Card.class);
   CardContainer container = mock(CardContainer.class);
   command.setModel(card);
   command.setContainer(container);
   command.initialize();
   assertThat(command.canExecute(), is(true));
 }