<commit_before>package edu.dynamic.dynamiz.controller;

import static org.junit.Assert.*;

import org.junit.Test;

import edu.dynamic.dynamiz.parser.CommandLine;
import edu.dynamic.dynamiz.parser.Parser;
import edu.dynamic.dynamiz.structure.MyDateTime;
import edu.dynamic.dynamiz.structure.EventItem;
import edu.dynamic.dynamiz.structure.ToDoItem;

/**
 * JUnit test case for Command Add.
 * @author A0110781N
 */
public class CommandAddTest {
    
    @Test
    public void test() {
	Parser parser = Parser.getInstance();
	
	CommandAdd cmd = (CommandAdd) parser.parse("Add Learn C++");
	// CommandAdd cmd = new CommandAdd(new ToDoItem("Learn C++"));
	cmd.execute();
	ToDoItem[] item = cmd.getAffectedItems();
	assertEquals("item has 1 object", 1, item.length);
	cmd.undo();
	
	cmd = (CommandAdd) parser.parse("add Learn C++ from 31/10/2014 12:00 to 11/11/2014 12:00");
	cmd.execute();
    }
    
    // TODO: Implement Exception for CommandAdd
    @Test(expected=IllegalArgumentException.class)
    public void testIllegalActions(){
	Parser parser = Parser.getInstance();
    }
}<commit_msg>Touches up CommandAddTest<commit_after>package edu.dynamic.dynamiz.controller;

import static org.junit.Assert.*;

import org.junit.Test;

import edu.dynamic.dynamiz.parser.CommandLine;
import edu.dynamic.dynamiz.parser.Parser;
import edu.dynamic.dynamiz.structure.MyDateTime;
import edu.dynamic.dynamiz.structure.EventItem;
import edu.dynamic.dynamiz.structure.ToDoItem;

/**
 * JUnit test case for Command Add.
 * @author A0110781N
 */
public class CommandAddTest {
    
    @Test
    public void test() {
	
	Command cmd = new CommandAdd(new ToDoItem("Learn C++"));
	cmd.execute();
	assertEquals(1, cmd.getAffectedItems().length);
	assertEquals("Learn C++", cmd.getAffectedItems()[0].getDescription());
	//((Undoable)cmd).undo();
	
	cmd = new CommandAdd(new EventItem("Learn C++", new MyDateTime(31, 10, 2014, 12, 0), new MyDateTime(11, 11, 2014, 12, 0)));
	cmd.execute();
	assertEquals(new MyDateTime(31, 10, 2014, 12, 0), ((EventItem)cmd.getAffectedItems()[0]).getStartDate());
	assertEquals(new MyDateTime(11, 11, 2014, 12, 0), ((EventItem)cmd.getAffectedItems()[0]).getEndDate());
	//((Undoable)cmd).undo();
    }
    
    // TODO: Implement Exception for CommandAdd
    @Test(expected=IllegalArgumentException.class)
    public void testIllegalActions(){
	Parser parser = Parser.getInstance();
    }
}
{'fraction_non_alphanumeric': 0.145, 'fraction_numerical': 0.03666666666666667, 'mean_word_length': 4.68957345971564, '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': '2977013', 'n_tokens_mistral': 865, 'n_tokens_neox': 774, 'n_words': 174}