package seedu.ezdo.model;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;

import mockit.Expectations;
import mockit.integration.junit4.JMockit;
import seedu.ezdo.commons.exceptions.IllegalValueException;
import seedu.ezdo.model.todo.Name;
import seedu.ezdo.model.todo.UniqueTaskList.DuplicateTaskException;
import seedu.ezdo.model.util.SampleDataUtil;

@RunWith(JMockit.class)
public class SampleDataUtilTest {

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

    @Test
    public void getSampleTasks_ive_throwsAssertionError() throws Exception {
        thrown.expect(AssertionError.class);
        new Expectations(Name.class) {{
            new Name("Buy one cherry fruit"); result = new IllegalValueException("illegal value");
        }};

        SampleDataUtil.getSampleTasks();
    }

    @Test
    public void getSampleEzDo_duplicateTask_throwsAssertionError() throws Exception {
        thrown.expect(AssertionError.class);
        new Expectations(EzDo.class) {{
            new EzDo(); result = new DuplicateTaskException();
        }};
        SampleDataUtil.getSampleEzDo();
    }

}

@@ -421,16 +421,37 @@
 aUtil;%0A%0A
+//@@author A0139248X%0A
 @RunWith
@@ -859,17 +859,16 @@
     %7D%7D;%0A
-%0A
         
@@ -1209,11 +1209,10 @@
 ;%0A    %7D%0A
-%0A
 %7D%0A

Add comments Remove whitespace