Exemple #1
0
        public void TestAddTaskICal()
        {
            string               x            = File.ReadAllText(MockPath + "todo.ics");
            Application          app          = new ApplicationClass();
            OutlookTasksWithICal agent        = new OutlookTasksWithICal(app);
            OutlookTasks         outlookAgent = new OutlookTasks(app);

            string entryId = outlookAgent.GetEntryIdByDisplayName("Demo Task Sunbird");

            if (entryId != null)
            {
                bool deletionOK = outlookAgent.DeleteItem(entryId);
                Assert.IsTrue(deletionOK);
            }
            agent.AddItem(x); //also test ReadTextToItem()
            entryId = outlookAgent.GetEntryIdByDisplayName("Demo Task Sunbird");
            Assert.IsTrue(entryId != null);

            TaskItem task       = outlookAgent.GetItemByEntryId(entryId);
            var      collection = iCalendar.LoadFromFile(MockPath + "todo.ics");
            var      calendar   = collection.FirstOrDefault();
            var      todo       = calendar.Todos[0];

            CompareIcalTodoAndAppointment(todo, task);
        }