/// <summary> /// 更新任务的最后更新时间 /// </summary> private void UpdateTaskLastUpdateTime(CooperTask task, DateTime lastUpdateTime) { task.SetLastUpdateTime(lastUpdateTime); _taskService.Update(task); }
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; }
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())); }
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)); }
private void AssertTaskAndAliyunCalendarEventAreEqual(CooperTask cooperTask, AliyunCalendarEventSyncData aliyunCalendarEvent) { MicrosoftAssert.AreEqual(cooperTask.Subject, aliyunCalendarEvent.Subject); MicrosoftAssert.AreEqual(cooperTask.Body, aliyunCalendarEvent.Body); MicrosoftAssert.AreEqual(cooperTask.DueTime, aliyunCalendarEvent.DueTime); MicrosoftAssert.AreEqual(FormatTime(cooperTask.LastUpdateTime), FormatTime(aliyunCalendarEvent.LastUpdateLocalTime)); }