package guitests;

import org.junit.Test;
import seedu.scheduler.testutil.TestEntry;
import seedu.scheduler.testutil.TestUtil;

import static org.junit.Assert.assertTrue;

public class EditCommandTest extends SchedulerGuiTest {

    @Test
    public void edit() {
        
        //edit the first in the list
        TestEntry[] currentList = td.getTypicalEntrys();
        int targetIndex = 1;
        TestEntry entryToEditTo = td.meeting;
        assertEditSuccess(targetIndex, currentList, entryToEditTo);
    }
    
    private void assertEditSuccess(int targetIndexOneIndexed, final TestEntry[] currentList, TestEntry entryToEditTo){
        //TestEntry entryToEdit = currentList[targetIndexOneIndexed-1]; //-1 because array starts from index 0
        commandBox.runCommand(entryToEditTo.getEditCommand(targetIndexOneIndexed));
        
        //confirm the list now contains all previous entrys plus the newly edited entry
        TestEntry[] expectedList = TestUtil.replaceEntryFromList(currentList, entryToEditTo, targetIndexOneIndexed-1);
        assertTrue(entryListPanel.isListMatching(expectedList));
    }
}

@@ -1039,18 +1039,16 @@
 eIndexed
--1
 );%0A     

Fix edit test case