Exemple #1
0
        [Test]//, Ignore( "Investigating problems on OMNIAMEA-UNIT")]
        public void Test()
        {
            FolderDescriptor folderDescriptor = FolderEnum.SearchFolder("Format");

            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 mail = messages.OpenMessage(0);
                    Assert.IsNotNull(mail);
                    using ( mail )
                    {
                        MessageBody msgBody = mail.GetRawBodyAsRTF();
                        Assert.AreEqual(MailBodyFormat.PlainTextInRTF, msgBody.Format);
                    }
                }
            }
        }
Exemple #2
0
            private void SearchForFolders()
            {
                FolderEnum folderEnum = FolderEnum.SearchForFolders(new string[] { "MoveFirst", "MoveSecond" });

                _folderFirst  = folderEnum.GetFolderDescriptor("MoveFirst");
                _folderSecond = folderEnum.GetFolderDescriptor("MoveSecond");
                _storeID      = _folderFirst.FolderIDs.StoreId;
            }
Exemple #3
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);
                    }
                }
            }
        }
Exemple #4
0
        public static FolderEnum SearchForFolders(string[] names, bool debug)
        {
            FolderEnum folderEnum = new FolderEnum(names);

            if (debug)
            {
                return(folderEnum);
            }
            foreach (IEMsgStore msgStore in OutlookSession.GetMsgStores())
            {
                FolderDescriptorEnumerator.Do(msgStore, msgStore.GetBinProp(MAPIConst.PR_STORE_ENTRYID), string.Empty, folderEnum);
            }
            folderEnum.AssertSearching();
            return(folderEnum);
        }
Exemple #5
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();
            }
        }
Exemple #6
0
            public void Test()
            {
                _folderEnum = FolderEnum.SearchForFolders(new string[] { "RuleTest" });
                _folderEnum = _folderEnum;

                _subject = Environment.TickCount.ToString();
                Console.WriteLine("init subject = " + _subject);

                JetBrains.Util.MailUtil.SendEMail("*****@*****.**", to, "mail.intellij.net", "RuleTest",
                                                  MailFormat.Text, _subject, false, new MailAttachment[0], false);
                int ticks = Environment.TickCount;

                OutlookMailDeliver.DeliverNow();
                while ((Environment.TickCount - ticks) < 30000)
                {
                    System.Threading.Thread.Sleep(1);
                    Application.DoEvents();
                }
                OutlookMailDeliver.DeliverNow();
            }