Ejemplo n.º 1
0
 public void ItShouldAddDueDateToTaskList()
 {
     var testAddCommand = new AddCommand();
     var arguments = new ArgumentList(new string[] { "add", "I added something", "2/7/2016" }, new string[] { "add" });
     var taskList = new TaskList();
     testAddCommand.Execute(arguments, taskList, new TagList(), new TagFolder());
     string actual = taskList.GetTask(0).DueDate.Date.ToString("d");
     string expected = "2/7/2016";
     Assert.AreEqual(expected, actual);
 }
Ejemplo n.º 2
0
 public void ItShouldAddToTaskList()
 {
     var testAddCommand = new AddCommand();
     var arguments = new ArgumentList(new string[] { "add", "I added something" }, new string[] { "add" });
     var taskList = new TaskList();
     testAddCommand.Execute(arguments, taskList, new TagList(), new TagFolder());
     string actual = taskList.GetTask(0).TaskDescription;
     string expected = "I added something";
     Assert.AreEqual(expected, actual);
 }
Ejemplo n.º 3
0
 public void ItShouldNotAddSameTaskToTaskList()
 {
     var testAddCommand = new AddCommand();
     var arguments = new ArgumentList(new string[] { "add", "I added something" }, new string[] { "add" });
     var taskList = new TaskList();
     Task testTask1 = new Task();
     testTask1.TaskDescription = "I added something";
     taskList.AddTask(ref testTask1);
     testAddCommand.Execute(arguments, taskList, new TagList(), new TagFolder());
     int actual = taskList.GetListSize();
     int expected = 1;
     Assert.AreEqual(expected, actual);
 }
Ejemplo n.º 4
0
 public void ItShouldFilterTasksThatArePastDue()
 {
     var testAddCommand = new AddCommand();
     var arguments1 = new ArgumentList(new string[] { "add", "I added something", DateTime.Today.ToString("d") }, new string[] { "add" });
     var arguments2 = new ArgumentList(new string[] { "add", "I added something else", "1/7/2016" }, new string[] { "add" });
     var taskList = new TaskList();
     testAddCommand.Execute(arguments1, taskList, new TagList(), new TagFolder());
     testAddCommand.Execute(arguments2, taskList, new TagList(), new TagFolder());
     var actual = taskList.FilterDue("past")[0].TaskDescription;
     var expected = "I added something else";
     Assert.AreEqual(expected, actual);
 }