<commit_before>package seedu.ezdo.model.task;

import java.text.ParseException;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.BDDMockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import seedu.ezdo.commons.exceptions.DateException;
import seedu.ezdo.commons.util.DateUtil;
import seedu.ezdo.model.ModelManager;
import seedu.ezdo.model.todo.ReadOnlyTask;
import seedu.ezdo.testutil.TaskBuilder;

@RunWith(PowerMockRunner.class)
@PrepareForTest(DateUtil.class)
public class ModelManagerTest {

    private ModelManager modelManager;

    @Rule
    public ExpectedException thrown = ExpectedException.none();

    @Before
    public void setUp() {
        modelManager = new ModelManager();
    }

    @Test
    public void checkDate_parseFail() throws Exception {
        ReadOnlyTask task = new TaskBuilder().build();
        PowerMockito.mockStatic(DateUtil.class);
        BDDMockito.given(DateUtil.isTaskDateValid(task))
                .willThrow(new ParseException("parse fail", 0));
        thrown.expect(DateException.class);
        modelManager.checkTaskDate(task);
    }
<commit_msg>Add test for compareDateStrings when called with invalid dates<commit_after>package seedu.ezdo.model.task;

import static seedu.ezdo.commons.util.DateUtil.compareDateStrings;

import java.text.ParseException;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.BDDMockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import seedu.ezdo.commons.exceptions.DateException;
import seedu.ezdo.commons.util.DateUtil;
import seedu.ezdo.model.ModelManager;
import seedu.ezdo.model.todo.ReadOnlyTask;
import seedu.ezdo.testutil.TaskBuilder;

@RunWith(PowerMockRunner.class)
@PrepareForTest(DateUtil.class)
public class ModelManagerTest {

    private ModelManager modelManager;

    @Rule
    public ExpectedException thrown = ExpectedException.none();

    @Before
    public void setUp() {
        modelManager = new ModelManager();
    }

    @Test
    public void checkDate_parseFail() throws Exception {
        ReadOnlyTask task = new TaskBuilder().build();
        PowerMockito.mockStatic(DateUtil.class);
        BDDMockito.given(DateUtil.isTaskDateValid(task))
                .willThrow(new ParseException("parse fail", 0));
        thrown.expect(DateException.class);
        modelManager.checkTaskDate(task);
    }

    @Test(expected = AssertionError.class)
    public void compareDate_parseFail() {
        String dateStringOne = "12345";
        String dateStringTwo = "11/11/2016";

        compareDateStrings(dateStringOne, dateStringTwo);
    }


{'fraction_non_alphanumeric': 0.0987450462351387, 'fraction_numerical': 0.005614266842800529, 'mean_word_length': 4.2770034843205575, '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': '5322673', 'n_tokens_mistral': 927, 'n_tokens_neox': 904, 'n_words': 164}