示例#1
0
 private void AssertTaskAndGoogleCalendarEventAreEqual(CooperTask cooperTask, Event calendarEvent)
 {
     MicrosoftAssert.AreEqual(cooperTask.Subject, calendarEvent.Summary);
     MicrosoftAssert.AreEqual(cooperTask.Body, calendarEvent.Description);
     MicrosoftAssert.AreEqual(cooperTask.DueTime.Value.Date, Rfc3339DateTime.Parse(calendarEvent.End.DateTime).ToLocalTime().Date);
     MicrosoftAssert.AreEqual(FormatTime(cooperTask.LastUpdateTime), FormatTime(Rfc3339DateTime.Parse(calendarEvent.Updated).ToLocalTime()));
 }
示例#2
0
        private void AssertTaskAndGoogleTaskAreEqual(CooperTask cooperTask, GoogleTask googleTask)
        {
            MicrosoftAssert.AreEqual(cooperTask.Subject, googleTask.Title);
            MicrosoftAssert.AreEqual(cooperTask.Body, googleTask.Notes);
            var dueDate = Rfc3339DateTime.Parse(googleTask.Due);

            MicrosoftAssert.AreEqual(cooperTask.DueTime, new DateTime(dueDate.Year, dueDate.Month, dueDate.Day));
            if (cooperTask.IsCompleted)
            {
                MicrosoftAssert.AreEqual("completed", googleTask.Status);
            }
            else
            {
                MicrosoftAssert.AreEqual("needsAction", googleTask.Status);
            }

            var lastUpdateTime = Rfc3339DateTime.Parse(googleTask.Updated).ToLocalTime();

            MicrosoftAssert.AreEqual(FormatTime(cooperTask.LastUpdateTime), FormatTime(lastUpdateTime));
        }
示例#3
0
        private CooperTask UpdateCooperTask(long taskId, string subject, string body, DateTime?dueTime, bool isCompleted)
        {
            CooperTask task = _taskService.GetTask(taskId);

            task.SetSubject(subject);
            task.SetBody(body);
            task.SetDueTime(dueTime);
            if (isCompleted)
            {
                task.MarkAsCompleted();
            }
            else
            {
                task.MarkAsInCompleted();
            }

            _taskService.Update(task);

            return(task);
        }
示例#4
0
        private CooperTask CreateCooperTask(string subject, string body, DateTime?dueTime, bool isCompleted)
        {
            CooperTask task = new CooperTask(_account);

            task.SetSubject(subject);
            task.SetBody(body);
            task.SetDueTime(dueTime);
            if (isCompleted)
            {
                task.MarkAsCompleted();
            }
            else
            {
                task.MarkAsInCompleted();
            }

            _taskService.Create(task);

            return(task);
        }
示例#5
0
 /// <summary>
 /// 更新任务的最后更新时间
 /// </summary>
 private void UpdateTaskLastUpdateTime(CooperTask task, DateTime lastUpdateTime)
 {
     task.SetLastUpdateTime(lastUpdateTime);
     _taskService.Update(task);
 }
示例#6
0
 /// <summary>
 /// 更新任务的最后更新时间
 /// </summary>
 private void UpdateTaskLastUpdateTime(CooperTask task, DateTime lastUpdateTime)
 {
     task.SetLastUpdateTime(lastUpdateTime);
     _taskService.Update(task);
 }
示例#7
0
        private CooperTask CreateCooperTask(string subject, string body, DateTime? dueTime, bool isCompleted)
        {
            CooperTask task = new CooperTask(_account);

            task.SetSubject(subject);
            task.SetBody(body);
            task.SetDueTime(dueTime);
            if (isCompleted)
            {
                task.MarkAsCompleted();
            }
            else
            {
                task.MarkAsInCompleted();
            }

            _taskService.Create(task);

            return task;
        }
示例#8
0
        private void AssertTaskAndGoogleTaskAreEqual(CooperTask cooperTask, GoogleTask googleTask)
        {
            MicrosoftAssert.AreEqual(cooperTask.Subject, googleTask.Title);
            MicrosoftAssert.AreEqual(cooperTask.Body, googleTask.Notes);
            var dueDate = Rfc3339DateTime.Parse(googleTask.Due);
            MicrosoftAssert.AreEqual(cooperTask.DueTime, new DateTime(dueDate.Year, dueDate.Month, dueDate.Day));
            if (cooperTask.IsCompleted)
            {
                MicrosoftAssert.AreEqual("completed", googleTask.Status);
            }
            else
            {
                MicrosoftAssert.AreEqual("needsAction", googleTask.Status);
            }

            var lastUpdateTime = Rfc3339DateTime.Parse(googleTask.Updated).ToLocalTime();
            MicrosoftAssert.AreEqual(FormatTime(cooperTask.LastUpdateTime), FormatTime(lastUpdateTime));
        }
示例#9
0
 private void AssertTaskAndGoogleCalendarEventAreEqual(CooperTask cooperTask, Event calendarEvent)
 {
     MicrosoftAssert.AreEqual(cooperTask.Subject, calendarEvent.Summary);
     MicrosoftAssert.AreEqual(cooperTask.Body, calendarEvent.Description);
     MicrosoftAssert.AreEqual(cooperTask.DueTime.Value.Date, Rfc3339DateTime.Parse(calendarEvent.End.DateTime).ToLocalTime().Date);
     MicrosoftAssert.AreEqual(FormatTime(cooperTask.LastUpdateTime), FormatTime(Rfc3339DateTime.Parse(calendarEvent.Updated).ToLocalTime()));
 }