Exemplo n.º 1
0
            private void SearchForFolders()
            {
                FolderEnum folderEnum = FolderEnum.SearchForFolders(new string[] { "MoveFirst", "MoveSecond" });

                _folderFirst  = folderEnum.GetFolderDescriptor("MoveFirst");
                _folderSecond = folderEnum.GetFolderDescriptor("MoveSecond");
                _storeID      = _folderFirst.FolderIDs.StoreId;
            }
Exemplo n.º 2
0
        [Test]//, Ignore( "Investigating problems on OMNIAMEA-UNIT")]
        public void GetSetCategories()
        {
            FolderEnum       folderEnum       = FolderEnum.SearchForFolders(new string[] { "TasksTest" });
            FolderDescriptor folderDescriptor = folderEnum.GetFolderDescriptor("TasksTest");

            Assert.IsNotNull(folderDescriptor);
            IEFolder folder =
                OutlookSession.OpenFolder(folderDescriptor.FolderIDs.EntryId, folderDescriptor.FolderIDs.StoreId);

            Assert.IsNotNull(folder);
            using ( folder )
            {
                IEMessages messages = folder.GetMessages();
                Assert.IsNotNull(messages);
                using ( messages )
                {
                    Assert.AreEqual(1, messages.GetCount());
                    IEMessage task = messages.OpenMessage(0);
                    Assert.IsNotNull(task);
                    using ( task )
                    {
                        ArrayList categories = OutlookSession.GetCategories(task);
                        Assert.AreEqual(null, categories);
                        categories = new ArrayList();
                        categories.Add("category1");
                        categories.Add("category2");
                        categories.Add("category3");
                        OutlookSession.SetCategories(task, categories);
                        task.SaveChanges();
                    }
                    task = messages.OpenMessage(0);
                    Assert.IsNotNull(task);
                    using ( task )
                    {
                        ArrayList categories = OutlookSession.GetCategories(task);
                        Assert.AreEqual(3, categories.Count);
                        categories.Remove("category1");
                        categories.Remove("category2");
                        categories.Remove("category3");
                        Assert.AreEqual(0, categories.Count);
                        OutlookSession.SetCategories(task, null);
                        task.SaveChanges();
                    }
                    task = messages.OpenMessage(0);
                    Assert.IsNotNull(task);
                    using ( task )
                    {
                        ArrayList categories = OutlookSession.GetCategories(task);
                        Assert.AreEqual(null, categories);
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void LoadTest()
        {
            //MessageBox.Show( "LoadTest" );
            for (int i = 0; i < 10; ++i)
            {
                Tracer._Trace("Test: " + i);
                OutlookSession.Initialize( );

                IEMsgStore msgStore = OutlookSession.GetDefaultMsgStore();
                Assert.IsNotNull(msgStore);
                FolderEnum folderEnum = FolderEnum.SearchForFolders(new string[] { "TasksTest" });
                folderEnum.GetFolderDescriptor("TasksTest");
                OutlookSession.Uninitialize();
            }
        }