当前位置: 首页>>代码示例>>C#>>正文


C# IMAPSimulator.Sort方法代码示例

本文整理汇总了C#中IMAPSimulator.Sort方法的典型用法代码示例。如果您正苦于以下问题:C# IMAPSimulator.Sort方法的具体用法?C# IMAPSimulator.Sort怎么用?C# IMAPSimulator.Sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMAPSimulator的用法示例。


在下文中一共展示了IMAPSimulator.Sort方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestMetaDataSortCC

        public void TestMetaDataSortCC()
        {
            hMailServer.Application application = SingletonProvider<Utilities>.Instance.GetApp();
             hMailServer.Account account = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "meta'[email protected]", "test");

             // disable...
             SendMessage("Test C", "Body", "", "ÄÄÄ");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);

             SendMessage("Test B", "Body", "", "ÖÖÖ");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 2);

             SendMessage("Test A", "Body", "", "ÅÅÅ");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 3);

             AssertAllMessagesIndexed();

             IMAPSimulator sim = new IMAPSimulator(account.Address, "test", "Inbox");

             string result = sim.Sort("(CC) UTF-8 ALL");

             Assert.AreEqual("3 1 2", result);

             // Disable the indexing functionality
             _indexing.Enabled = false;
             _indexing.Clear();

             // Make sure the sort order is the same.
             string resultAfter = sim.Sort("(CC) UTF-8 ALL");

             Assert.AreEqual(result, resultAfter);
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:32,代码来源:IMAP.MessageIndexing.cs

示例2: TestMetaDataSortSubjectAnsi

        public void TestMetaDataSortSubjectAnsi()
        {
            hMailServer.Application application = SingletonProvider<Utilities>.Instance.GetApp();
             hMailServer.Account account = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "meta'[email protected]", "test");

             // disable...
             SendMessage("Test 1", "Body", "", "");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);

             SendMessage("Test 2", "Body", "", "");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 2);

             AssertAllMessagesIndexed();

             IMAPSimulator sim = new IMAPSimulator(account.Address, "test", "Inbox");

             string result = sim.Sort("(SUBJECT) UTF-8 ALL");

             Assert.IsTrue(result.StartsWith("1 2"));

             // Disable the indexing functionality
             _indexing.Enabled = false;
             _indexing.Clear();

             // Make sure the sort order is the same.
             string resultAfter = sim.Sort("(SUBJECT) UTF-8 ALL");

             Assert.AreEqual(result, resultAfter);
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:29,代码来源:IMAP.MessageIndexing.cs

示例3: TestMetaDataSortSubjectGreek

        public void TestMetaDataSortSubjectGreek()
        {
            hMailServer.Application application = SingletonProvider<Utilities>.Instance.GetApp();
             hMailServer.Account account = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "meta'[email protected]", "test");

             // disable...
             SendMessage("Test Σ", "Body", "", "");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);
             // pos: 18

             SendMessage("Test Α", "Body", "", "");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 2);
             // pos: 1

             SendMessage("Test Δ", "Body", "", "");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 3);
             // pos: 4

             SendMessage("Test β", "Body", "", "");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 4);
             // pos: 2

             SendMessage("Test κ", "Body", "", "");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 5);
             // pos: 10

             SendMessage("Test Ψ", "Body", "", "");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 6);
             // pos: 23

             AssertAllMessagesIndexed();

             IMAPSimulator sim = new IMAPSimulator(account.Address, "test", "Inbox");

             string result = sim.Sort("(SUBJECT) UTF-8 ALL");

             Assert.AreEqual("2 4 3 5 1 6", result);

             // Disable the indexing functionality
             _indexing.Enabled = false;
             _indexing.Clear();

             // Make sure the sort order is the same.
             string resultAfter = sim.Sort("(SUBJECT) UTF-8 ALL");

             Assert.AreEqual(result, resultAfter);
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:47,代码来源:IMAP.MessageIndexing.cs

示例4: TestSubjectSearchValueWithParanthesis

        public void TestSubjectSearchValueWithParanthesis()
        {
            hMailServer.Domain oDomain = _application.Domains[0];
             hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");

             // Send a message to this account.
             SMTPClientSimulator oSMTP = new SMTPClientSimulator();
             oSMTP.Send("[email protected]", "[email protected]", "Te(st1", "This is a test of IMAP Search");
             IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 1);
             oSMTP.Send("[email protected]", "[email protected]", "Te)st2", "This is a test of IMAP Search");
             IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 2);

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");
             Assert.IsTrue(oSimulator.SelectFolder("INBOX"));

             Assert.AreEqual("1", oSimulator.Sort("(SUBJECT) UTF-8 ALL HEADER SUBJECT \"Te(st1\""));
             Assert.AreEqual("2", oSimulator.Sort("(SUBJECT) UTF-8 ALL HEADER SUBJECT \"Te)st2\""));
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:21,代码来源:IMAP.Sort.cs

示例5: TestSortSubjectSearch

        public void TestSortSubjectSearch()
        {
            hMailServer.Domain oDomain = _application.Domains[0];
             hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");

             // Send a message to this account.
             SMTPClientSimulator oSMTP = new SMTPClientSimulator();
             oSMTP.Send("[email protected]", "[email protected]", "aa", "This is a test of IMAP Search");
             IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 1);
             oSMTP.Send("[email protected]", "[email protected]", "bb", "This is a test of IMAP Search");
             IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 2);

             IMAPSimulator oSimulator = new IMAPSimulator();
             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");
             Assert.IsTrue(oSimulator.SelectFolder("INBOX"));

             Assert.AreEqual("1 2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR HEADER SUBJECT aa HEADER SUBJECT bb"));
             Assert.AreEqual("1 2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR (HEADER SUBJECT aa) (HEADER SUBJECT bb)"));
             Assert.AreEqual("1 2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED (OR HEADER SUBJECT aa HEADER SUBJECT bb)"));

             Assert.AreEqual("1", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR HEADER SUBJECT aa HEADER SUBJECT cc"));
             Assert.AreEqual("1", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR (HEADER SUBJECT aa) (HEADER SUBJECT cc)"));
             Assert.AreEqual("1", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED (OR HEADER SUBJECT aa HEADER SUBJECT cc)"));

             Assert.AreEqual("2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR HEADER SUBJECT bb HEADER SUBJECT cc"));
             Assert.AreEqual("2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR (HEADER SUBJECT bb) (HEADER SUBJECT cc)"));
             Assert.AreEqual("2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED (OR HEADER SUBJECT bb HEADER SUBJECT cc)"));
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:29,代码来源:IMAP.Sort.cs

示例6: TestSortReverseSize

        public void TestSortReverseSize()
        {
            hMailServer.Domain oDomain = _application.Domains[0];
             hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");

             StringBuilder longBodyString = new StringBuilder();
             longBodyString.Append('A', 10000);

             // Send a message to this account.
             SMTPClientSimulator oSMTP = new SMTPClientSimulator();
             oSMTP.Send("[email protected]", "[email protected]", "Test1", longBodyString.ToString());
             IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 1);

             oSMTP.Send("[email protected]", "[email protected]", "Test2", "Test body");
             IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 2);

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");
             Assert.IsTrue(oSimulator.SelectFolder("INBOX"));

             Assert.AreEqual("2 1", oSimulator.Sort("(SIZE) UTF-8 ALL"));
             Assert.AreEqual("1 2", oSimulator.Sort("(REVERSE SIZE) UTF-8 ALL"));
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:25,代码来源:IMAP.Sort.cs

示例7: TestSortReverseArrival

        public void TestSortReverseArrival()
        {
            hMailServer.Domain oDomain = _application.Domains[0];
             hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");

             // Send a message to this account.
             SMTPClientSimulator oSMTP = new SMTPClientSimulator();
             oSMTP.Send("[email protected]", "[email protected]", "Test1", "This is a test of IMAP Search");
             IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 1);

             // The two messages needs to be sent a second apart, so we actually need to pause a bit here.

             System.Threading.Thread.Sleep(1000);
             oSMTP.Send("[email protected]", "[email protected]", "Test2", "This is a test of IMAP Search");
             IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 2);

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");
             Assert.IsTrue(oSimulator.SelectFolder("INBOX"));

             Assert.AreEqual("1 2", oSimulator.Sort("(ARRIVAL) UTF-8 ALL"));
             Assert.AreEqual("2 1", oSimulator.Sort("(REVERSE ARRIVAL) UTF-8 ALL"));
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:25,代码来源:IMAP.Sort.cs

示例8: TestSortDeletedOrAnswered

        public void TestSortDeletedOrAnswered()
        {
            hMailServer.Domain oDomain = _application.Domains[0];
             hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");

             // Send a message to this account.
             SMTPClientSimulator oSMTP = new SMTPClientSimulator();
             oSMTP.Send("[email protected]", "[email protected]", "aa", "This is a test of IMAP Search");
             IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 1);
             oSMTP.Send("[email protected]", "[email protected]", "bb", "This is a test of IMAP Search");
             IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 2);

             IMAPSimulator oSimulator = new IMAPSimulator();
             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");
             Assert.IsTrue(oSimulator.SelectFolder("INBOX"));

             Assert.AreEqual("", oSimulator.Sort("(DATE) UTF-8 ALL OR ANSWERED DELETED"));
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:19,代码来源:IMAP.Sort.cs


注:本文中的IMAPSimulator.Sort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。