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


C# ImapClientSimulator.Sort方法代码示例

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


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

示例1: TestMetaDataSortCC

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

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

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

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

             AssertAllMessagesIndexed();

             var sim = new ImapClientSimulator(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:SpivEgin,项目名称:hmailserver,代码行数:32,代码来源:MessageIndexing.cs

示例2: TestSubjectSearchValueWithParanthesis

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

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

             var oSimulator = new ImapClientSimulator();

             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:SpivEgin,项目名称:hmailserver,代码行数:21,代码来源:Sort.cs

示例3: TestSortSubjectSearch

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

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

             var oSimulator = new ImapClientSimulator();
             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:SpivEgin,项目名称:hmailserver,代码行数:33,代码来源:Sort.cs

示例4: TestSortReverseSize

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

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

             // Send a message to this account.
             var smtpClientSimulator = new SmtpClientSimulator();
             smtpClientSimulator.Send("[email protected]", "[email protected]", "Test1", longBodyString.ToString());
             ImapClientSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 1);

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

             var oSimulator = new ImapClientSimulator();

             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:SpivEgin,项目名称:hmailserver,代码行数:25,代码来源:Sort.cs

示例5: TestSortReverseArrival

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

             // Send a message to this account.
             var smtpClientSimulator = new SmtpClientSimulator();
             smtpClientSimulator.Send("[email protected]", "[email protected]", "Test1", "This is a test of IMAP Search");
             ImapClientSimulator.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.

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

             var oSimulator = new ImapClientSimulator();

             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:SpivEgin,项目名称:hmailserver,代码行数:25,代码来源:Sort.cs

示例6: TestSortDeletedOrAnswered

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

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

             var oSimulator = new ImapClientSimulator();
             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:SpivEgin,项目名称:hmailserver,代码行数:19,代码来源:Sort.cs

示例7: TestMetaDataSortSubjectTurkish

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

             // disable...
             SendMessage("Test Ç", "Body", "", "");
             ImapClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);
             // pos: 4

             SendMessage("Test C", "Body", "", "");
             ImapClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 2);
             // pos: 3

             SendMessage("Test B", "Body", "", "");
             ImapClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 3);
             // pos: 2

             SendMessage("Test Ğ", "Body", "", "");
             ImapClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 4);
             // pos: 9

             SendMessage("Test G", "Body", "", "");
             ImapClientSimulator.AssertMessageCount(account.Address, "test", "Inbox", 5);
             // pos: 8

             AssertAllMessagesIndexed();

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

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

             Assert.AreEqual("3 2 1 5 4", 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:SpivEgin,项目名称:hmailserver,代码行数:43,代码来源:MessageIndexing.cs

示例8: TestMetaDataSortSubjectAnsi

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

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

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

             AssertAllMessagesIndexed();

             var sim = new ImapClientSimulator(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:SpivEgin,项目名称:hmailserver,代码行数:29,代码来源:MessageIndexing.cs


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