本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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\""));
}
示例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)"));
}
示例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"));
}
示例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"));
}
示例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"));
}