コード例 #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);
        }
コード例 #2
0
        public void TestAddTasks()
        {
            XElement             x            = XElement.Load(MockPath + "SifT.xml");
            Application          app          = new ApplicationClass();
            OutlookTasksWithSifT agent        = new OutlookTasksWithSifT(app);
            OutlookTasks         outlookAgent = new OutlookTasks(app);

            string entryId = outlookAgent.GetEntryIdByDisplayName(subject);

            if (entryId != null)
            {
                bool deletionOK = outlookAgent.DeleteItem(entryId);
                Assert.IsTrue(deletionOK);
            }
            agent.AddItem(x.ToString());
            entryId = outlookAgent.GetEntryIdByDisplayName(subject);
            Assert.IsTrue(entryId != null);
        }