@@ -0,0 +1,2343 @@
+package jfdi.test.logic.commands;%0A%0Aimport jfdi.logic.commands.UnaliasCommand;%0Aimport jfdi.logic.events.UnaliasFailedEvent;%0Aimport jfdi.storage.apis.AliasAttributes;%0Aimport jfdi.storage.exceptions.InvalidAliasException;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport static org.junit.Assert.*;%0Aimport static org.mockito.Matchers.anyCollectionOf;%0Aimport static org.mockito.Mockito.*;%0A%0A/**%0A * @author Liu Xinan%0A */%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class UnaliasCommandTest extends CommonCommandTest %7B%0A%0A    @Test%0A    public void testBuilder() throws Exception %7B%0A        UnaliasCommand command = new UnaliasCommand.Builder()%0A            .setAlias(%22ls%22)%0A            .build();%0A%0A        assertEquals(%22ls%22, command.getAlias());%0A    %7D%0A%0A    @Test%0A    public void testExecute_successful() throws Exception %7B%0A        UnaliasCommand command = new UnaliasCommand.Builder()%0A            .setAlias(%22ls%22)%0A            .build();%0A%0A        command.execute();%0A%0A        verify(aliasDb).destroy(%22ls%22);%0A        verify(aliasDb).getAll();%0A        verify(parser).setAliases(anyCollectionOf(AliasAttributes.class));%0A    %7D%0A%0A    @Test%0A    public void testExecute_unsuccessful() throws Exception %7B%0A        doThrow(InvalidAliasException.class).when(aliasDb).destroy(%22ls%22);%0A%0A        UnaliasCommand command = new UnaliasCommand.Builder()%0A            .setAlias(%22ls%22)%0A            .build();%0A%0A        command.execute();%0A%0A        verify(aliasDb).destroy(%22ls%22);%0A        verifyNoMoreInteractions(aliasDb);%0A        verifyZeroInteractions(parser);%0A        verify(eventBus).post(any(UnaliasFailedEvent.class));%0A    %7D%0A%0A    @Test%0A    public void testUndo_successful() throws Exception %7B%0A        UnaliasCommand command = new UnaliasCommand.Builder()%0A            .setAlias(%22ls%22)%0A            .build();%0A%0A        command.undo();%0A%0A        verify(aliasDb).undestroy(%22ls%22);%0A        verify(aliasDb).getAll();%0A        verify(parser).setAliases(anyCollectionOf(AliasAttributes.class));%0A    %7D%0A%0A    @Test%0A    public void testUndo_unsuccessful() throws Exception %7B%0A        doThrow(InvalidAliasException.class).when(aliasDb).undestroy(%22ls%22);%0A%0A        UnaliasCommand command = new UnaliasCommand.Builder()%0A            .setAlias(%22ls%22)%0A            .build();%0A%0A        thrown.expect(AssertionError.class);%0A        command.undo();%0A    %7D%0A%0A%7D%0A

Add test for `UnaliasCommand`