コード例 #1
0
 public void should_return_most_recent_task()
 {
     Timesheet timesheet = new Timesheet(_file);
     Assert.AreEqual(_task, timesheet.GetLastTask());
 }
コード例 #2
0
        public void should_append_task_to_file()
        {
            Timesheet timesheet = new Timesheet(_file);
            timesheet.Update(_task);

            string content = string.Format("{0},{1},{2},\"{3}\",\"{4}\"{5}", _taskDate, _taskDate.DayOfWeek, _task.Duration.TotalHours, _task.Activity, _task.Note, Environment.NewLine);

            _file.AssertWasCalled(file=>file.AppendAllText(content));
        }
コード例 #3
0
 public void should_return_empty_task()
 {
     Timesheet sut = new Timesheet(_file);
     Assert.AreEqual(new Task(), sut.GetLastTask());
 }
コード例 #4
0
 public void should_return_task_contained_in_file()
 {
     Timesheet timesheet = new Timesheet(_file);
     Assert.AreEqual(_task, timesheet.GetLastTask());
 }