本文整理汇总了C#中RegressionTests.Shared.IMAPClientSimulator.Sort方法的典型用法代码示例。如果您正苦于以下问题:C# IMAPClientSimulator.Sort方法的具体用法?C# IMAPClientSimulator.Sort怎么用?C# IMAPClientSimulator.Sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RegressionTests.Shared.IMAPClientSimulator
的用法示例。
在下文中一共展示了IMAPClientSimulator.Sort方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
CustomAssert.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");
CustomAssert.AreEqual(result, resultAfter);
}
示例2: 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");
CustomAssert.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");
CustomAssert.AreEqual(result, resultAfter);
}
示例3: 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 oSMTP = new SMTPClientSimulator();
oSMTP.Send("[email protected]", "[email protected]", "Te(st1", "This is a test of IMAP Search");
IMAPClientSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 1);
oSMTP.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");
CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));
CustomAssert.AreEqual("1", oSimulator.Sort("(SUBJECT) UTF-8 ALL HEADER SUBJECT \"Te(st1\""));
CustomAssert.AreEqual("2", oSimulator.Sort("(SUBJECT) UTF-8 ALL HEADER SUBJECT \"Te)st2\""));
}
示例4: 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 oSMTP = new SMTPClientSimulator();
oSMTP.Send("[email protected]", "[email protected]", "aa", "This is a test of IMAP Search");
IMAPClientSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 1);
oSMTP.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");
CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));
CustomAssert.AreEqual("1 2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR HEADER SUBJECT aa HEADER SUBJECT bb"));
CustomAssert.AreEqual("1 2",
oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR (HEADER SUBJECT aa) (HEADER SUBJECT bb)"));
CustomAssert.AreEqual("1 2",
oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED (OR HEADER SUBJECT aa HEADER SUBJECT bb)"));
CustomAssert.AreEqual("1", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR HEADER SUBJECT aa HEADER SUBJECT cc"));
CustomAssert.AreEqual("1",
oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR (HEADER SUBJECT aa) (HEADER SUBJECT cc)"));
CustomAssert.AreEqual("1", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED (OR HEADER SUBJECT aa HEADER SUBJECT cc)"));
CustomAssert.AreEqual("2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR HEADER SUBJECT bb HEADER SUBJECT cc"));
CustomAssert.AreEqual("2",
oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED OR (HEADER SUBJECT bb) (HEADER SUBJECT cc)"));
CustomAssert.AreEqual("2", oSimulator.Sort("(DATE) UTF-8 ALL UNANSWERED (OR HEADER SUBJECT bb HEADER SUBJECT cc)"));
}
示例5: 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 oSMTP = new SMTPClientSimulator();
oSMTP.Send("[email protected]", "[email protected]", "Test1", longBodyString.ToString());
IMAPClientSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 1);
oSMTP.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");
CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));
CustomAssert.AreEqual("2 1", oSimulator.Sort("(SIZE) UTF-8 ALL"));
CustomAssert.AreEqual("1 2", oSimulator.Sort("(REVERSE SIZE) UTF-8 ALL"));
}
示例6: 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 oSMTP = new SMTPClientSimulator();
oSMTP.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);
oSMTP.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");
CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));
CustomAssert.AreEqual("1 2", oSimulator.Sort("(ARRIVAL) UTF-8 ALL"));
CustomAssert.AreEqual("2 1", oSimulator.Sort("(REVERSE ARRIVAL) UTF-8 ALL"));
}
示例7: 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 oSMTP = new SMTPClientSimulator();
oSMTP.Send("[email protected]", "[email protected]", "aa", "This is a test of IMAP Search");
IMAPClientSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 1);
oSMTP.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");
CustomAssert.IsTrue(oSimulator.SelectFolder("INBOX"));
CustomAssert.AreEqual("", oSimulator.Sort("(DATE) UTF-8 ALL OR ANSWERED DELETED"));
}