package seedu.todo.guitests;

import static org.junit.Assert.*;

import org.junit.Test;

import seedu.todo.guitests.guihandles.AliasItemHandle;

// @@author A0139812A
public class AliasCommandTest extends GuiTest {

    @Test
    public void alias_view_success() {
        console.runCommand("alias");
        assertTrue(aliasView.hasLoaded());
    }
    
    @Test
    public void alias_toList_success() {
        console.runCommand("alias list ls");
        System.out.println("hello");
        assertAliasItemVisible("list", "ls");
    }
    
    /**
     * Helper function to assert that AliasItem is visible.
     */
    private void assertAliasItemVisible(String aliasKey, String aliasValue) {
        // Make sure we can see the Alias View.
        assertTrue(aliasView.hasLoaded());
        
        // Gets the matching AliasItem. Since it matches, if it's not null -> it definitely exists.
        AliasItemHandle aliasItem = aliasView.getAliasItem(aliasKey, aliasValue);
        assertNotNull(aliasItem);
    }

}

@@ -136,16 +136,47 @@
 mHandle;
+%0Aimport seedu.todo.models.Task;
 %0A%0A// @@a
@@ -488,33 +488,95 @@
     
-System.out.println(%22hello
+assertAliasItemVisible(%22list%22, %22ls%22);%0A        %0A        console.runCommand(%22add Buy milk
 %22);%0A
@@ -587,43 +587,122 @@
     
+T
 as
-sertAliasItemVisible(%22list%22, %22ls%22
+k testTask = new Task();%0A        testTask.setName(%22Buy milk%22);%0A        assertTaskVisibleAfterCmd(%22ls%22, testTask
 );%0A 

Complete alias list test case