@Override protected void createCommand() { command = new CreateCardCommand(); card = mock(Card.class); command.setModel(card); container = mock(CardContainer.class); command.setContainer(container); command.initialize(); }
@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)); }