<commit_before>package guitests;

import static org.junit.Assert.assertTrue;
import static seedu.task.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;

import java.io.IOException;

import org.junit.Test;

import seedu.task.commons.core.Messages;
import seedu.task.commons.exceptions.DataConversionException;
import seedu.task.logic.commands.EditCommand;
import seedu.task.model.task.Name;
import seedu.task.testutil.TestTask;
import seedu.task.testutil.TestTaskBuilder;

//@@author A0139938L

// TODO: reduce GUI tests by transferring some tests to be covered by lower level tests.
public class EditCommandTest extends TaskManagerGuiTest {

    private TestTask[] expectedTasksList;

    // The list of tasks in the task list panel
    // is expected to match this list.
    // This list is updated with every successful call to assertEditSuccess().
    public EditCommandTest() {
        try {
            expectedTasksList = td.getTypicalTasks();
        } catch (DataConversionException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    //@@author A0139410N
    @Test
    public void edit_allFieldsSpecified_success() throws Exception {
        commandBox.runCommand("unchecked 1");
        String detailsToEdit = "Bobby from 11/12/12 00:00 to 11/13/12 00:00 #husband";
        int taskManagerIndex = 1;

        TestTask editedTask = new TestTaskBuilder().withName("Bobby").withStartDate("11/12/12 00:00")
                .withEndDate("11/13/12 00:00").withCompletion(false, "overdue").withTags("husband")
                .withTaskType("event").build();

        assertEditSuccess(taskManagerIndex, taskManagerIndex, detailsToEdit, editedTask);
    }

    @Test
    public void edit_notAllFieldsSpecified_success() throws Exception {
        String detailsToEdit = "#bestie";
        int taskManagerIndex = 2;

        TestTask taskToEdit = expectedTasksList[taskManagerIndex - 1];
        TestTask editedTask = new TestTaskBuilder(taskToEdit).withTags("bestie").build();<commit_msg>Quick fix for Edit Command Tests<commit_after>package guitests;

import static org.junit.Assert.assertTrue;
import static seedu.task.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;

import java.io.IOException;

import org.junit.Test;

import seedu.task.commons.core.Messages;
import seedu.task.commons.exceptions.DataConversionException;
import seedu.task.logic.commands.EditCommand;
import seedu.task.model.task.Name;
import seedu.task.testutil.TestTask;
import seedu.task.testutil.TestTaskBuilder;

//@@author A0139938L

// TODO: reduce GUI tests by transferring some tests to be covered by lower level tests.
public class EditCommandTest extends TaskManagerGuiTest {

    private TestTask[] expectedTasksList;

    // The list of tasks in the task list panel
    // is expected to match this list.
    // This list is updated with every successful call to assertEditSuccess().
    public EditCommandTest() {
        try {
            expectedTasksList = td.getTypicalTasks();
        } catch (DataConversionException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    //@@author A0139410N
    @Test
    public void edit_allFieldsSpecified_success() throws Exception {
        commandBox.runCommand("unchecked 1");
        String detailsToEdit = "Bobby from 12/11/12 00:00 to 13/11/12 00:00 #husband";
        int taskManagerIndex = 1;

        TestTask editedTask = new TestTaskBuilder().withName("Bobby").withStartDate("12/11/12 00:00")
                .withEndDate("13/11/12 00:00").withCompletion(false, "overdue").withTags("husband")
                .withTaskType("event").build();

        assertEditSuccess(taskManagerIndex, taskManagerIndex, detailsToEdit, editedTask);
    }

    @Test
    public void edit_notAllFieldsSpecified_success() throws Exception {
        String detailsToEdit = "#bestie";
        int taskManagerIndex = 2;

        TestTask taskToEdit = expectedTasksList[taskManagerIndex - 1];
        TestTask editedTask = new TestTaskBuilder(taskToEdit).withTags("bestie").build();
{'fraction_non_alphanumeric': 0.0960656529085204, 'fraction_numerical': 0.02799903451605117, 'mean_word_length': 3.417910447761194, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2879580', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1135, 'n_words': 292}