package seedu.address.logic.commands;

import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.testutil.TypicalPersons.getTypicalAddressBook;

import org.junit.Test;

import seedu.address.logic.CommandHistory;
import seedu.address.model.Model;
import seedu.address.model.ModelManager;
import seedu.address.model.UserPrefs;

public class ClearCommandTest {

    @Test
    public void execute_emptyAddressBook_success() {
        Model model = new ModelManager();
        assertCommandSuccess(prepareCommand(model), model, ClearCommand.MESSAGE_SUCCESS, model);
    }

    @Test
    public void execute_nonEmptyAddressBook_success() {
        Model model = new ModelManager(getTypicalAddressBook(), new UserPrefs());
        assertCommandSuccess(prepareCommand(model), model, ClearCommand.MESSAGE_SUCCESS, model);
    }

    /**
     * Generates a new {@code ClearCommand} which upon execution, clears the contents in {@code model}.
     */
    private ClearCommand prepareCommand(Model model) {
        ClearCommand command = new ClearCommand();
        command.setData(model, new CommandHistory());
        return command;
    }
}

@@ -256,16 +256,56 @@
 istory;%0A
+import seedu.address.model.AddressBook;%0A
 import s
@@ -544,24 +544,118 @@
 lManager();%0A
+        Model expectedModel = new ModelManager();%0A        expectedModel.commitAddressBook();%0A%0A
         asse
@@ -723,33 +723,41 @@
 ESSAGE_SUCCESS, 
-m
+expectedM
 odel);%0A    %7D%0A%0A  
@@ -898,24 +898,210 @@
 erPrefs());%0A
+        Model expectedModel = new ModelManager(getTypicalAddressBook(), new UserPrefs());%0A        expectedModel.resetData(new AddressBook());%0A        expectedModel.commitAddressBook();%0A%0A
         asse
@@ -1177,17 +1177,25 @@
 UCCESS, 
-m
+expectedM
 odel);%0A 

fix tautological tests