本文整理汇总了C#中RegressionTests.Shared.IMAPSimulator.Logon方法的典型用法代码示例。如果您正苦于以下问题:C# IMAPSimulator.Logon方法的具体用法?C# IMAPSimulator.Logon怎么用?C# IMAPSimulator.Logon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RegressionTests.Shared.IMAPSimulator
的用法示例。
在下文中一共展示了IMAPSimulator.Logon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestBatchOfCommands
public void TestBatchOfCommands()
{
Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(account.Address, "test");
string commandSequence = "";
for (int i = 0; i < 200; i++)
{
commandSequence += "A" + i.ToString() + " SELECT INBOX\r\n";
}
commandSequence = commandSequence.TrimEnd("\r\n".ToCharArray());
string result = oSimulator.Send(commandSequence);
CustomAssert.IsFalse(result.StartsWith("* BYE"));
oSimulator.Disconnect();
sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(account.Address, "test");
commandSequence = "";
for (int i = 0; i < 500; i++)
{
commandSequence += "A" + i.ToString() + " SELECT INBOX\r\n";
}
commandSequence = commandSequence.TrimEnd("\r\n".ToCharArray());
result = oSimulator.Send(commandSequence);
CustomAssert.IsFalse(result.StartsWith("* BYE Excessive number of buffered commands"));
oSimulator.Disconnect();
}
示例2: TestNestedOrSearch
public void TestNestedOrSearch()
{
Application application = SingletonProvider<TestSetup>.Instance.GetApp();
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]", "Search test", "This is a test of IMAP Search");
IMAPSimulator.AssertMessageCount(oAccount.Address, "test", "Inbox", 1);
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
oSimulator.SelectFolder("INBOX");
string result =
oSimulator.SendSingleCommand("A4 SEARCH ALL OR OR SINCE 28-May-2008 SINCE 28-May-2008 SINCE 28-May-2008");
Assert.IsTrue(result.StartsWith("* SEARCH 1"), result);
result = oSimulator.SendSingleCommand("A4 SEARCH ALL OR SMALLER 1 LARGER 10000");
Assert.IsTrue(result.StartsWith("* SEARCH\r\n"), result);
result = oSimulator.SendSingleCommand("A4 SEARCH ALL OR OR SMALLER 1 LARGER 10000 SMALLER 10000");
Assert.IsTrue(result.StartsWith("* SEARCH 1\r\n"), result);
}
示例3: TestCreateFolderWithHash
public void TestCreateFolderWithHash()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPSimulator();
oSimulator.Connect();
oSimulator.Logon(oAccount.Address, "test");
CustomAssert.IsFalse(oSimulator.CreateFolder("#Test"));
CustomAssert.IsTrue(oSimulator.CreateFolder("Test.#Testar"));
oSimulator.Disconnect();
}
示例4: TestCreateFolderWithSlash
public void TestCreateFolderWithSlash()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
const string folderName = "ABC\\123";
var oSimulator = new IMAPSimulator();
oSimulator.Connect();
oSimulator.Logon(oAccount.Address, "test");
CustomAssert.IsTrue(oSimulator.CreateFolder(folderName));
CustomAssert.IsTrue(oSimulator.List().Contains(folderName));
CustomAssert.IsTrue(oSimulator.SelectFolder(folderName));
oSimulator.Disconnect();
}
示例5: TestAppendDeletedMessage
public void TestAppendDeletedMessage()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
oSimulator.SendSingleCommandWithLiteral("A01 APPEND INBOX (\\Deleted) {4}", "ABCD");
Assert.AreEqual(1, oSimulator.GetMessageCount("INBOX"));
Assert.AreEqual("1", oSimulator.Search("DELETED"));
oSimulator.Disconnect();
}
示例6: TestLongCommand
public void TestLongCommand()
{
Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(account.Address, "test");
var sb = new StringBuilder();
for (int i = 0; i < 240000; i++)
{
sb.Append("A");
}
string result = oSimulator.Send("A01 " + sb);
CustomAssert.IsTrue(result.Length == 0 || result.StartsWith("A01"));
}
示例7: TestHierarchyDelimiterListResponse
public void TestHierarchyDelimiterListResponse()
{
Application application = SingletonProvider<TestSetup>.Instance.GetApp();
Settings settings = _settings;
settings.IMAPHierarchyDelimiter = "\\";
Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
string folderName = "Test\\Test";
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(account.Address, "test");
Assert.IsTrue(oSimulator.CreateFolder(folderName));
string listResponse = oSimulator.List();
Assert.IsTrue(listResponse.Contains("\"Test\\Test\""));
Assert.IsTrue(listResponse.Contains("\"Test\""));
oSimulator.Disconnect();
}
示例8: TestAppendFolderNameInOctet
public void TestAppendFolderNameInOctet()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
oSimulator.SelectFolder("INBOX");
oSimulator.CreateFolder("MONK");
oSimulator.SendRaw("A01 APPEND {4}\r\n");
string result = oSimulator.Receive();
Assert.IsTrue(result.StartsWith("+ Ready for additional command text."));
oSimulator.SendRaw("MONK (\\Seen) \"20-Jan-2009 12:59:50 +0100\" {5}\r\n");
result = oSimulator.Receive();
Assert.IsTrue(result.StartsWith("+ Ready for literal data"));
oSimulator.SendRaw("WOOOT\r\n");
result = oSimulator.Receive();
Assert.AreEqual("A01 OK APPEND completed\r\n", result);
}
示例9: TestNamespace
public void TestNamespace()
{
string imapFolderName = _settings.IMAPPublicFolderName;
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
string result = oSimulator.Send("A01 NAMESPACE");
string correctNamespaceSetting = "* NAMESPACE ((\"\" \".\")) NIL ((\"" + imapFolderName + "\" \".\"))";
if (!result.Contains(correctNamespaceSetting))
{
Assert.Fail("Namespace failed");
}
}
示例10: TestIdle
public void TestIdle()
{
_settings.IMAPIdleEnabled = true;
Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(account.Address, "test");
Assert.IsTrue(oSimulator.SelectFolder("INBOX"));
oSimulator.StartIdle();
if (oSimulator.GetPendingDataExists())
throw new Exception("Unexpected data exists");
// Send a message to this account.
var oSMTP = new SMTPClientSimulator();
oSMTP.Send(account.Address, account.Address, "IDLE Test", "This is a test of IDLE");
string data;
Assert.IsTrue(oSimulator.EndIdle(false, out data));
}
示例11: TestGetQuota
public void TestGetQuota()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
string result = oSimulator.GetQuota("Inbox");
Assert.IsTrue(result.Contains("A01 OK"));
oSimulator.Disconnect();
}
示例12: TestRename
public void TestRename()
{
Application application = SingletonProvider<TestSetup>.Instance.GetApp();
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
Assert.IsTrue(oSimulator.CreateFolder("Root1"));
Assert.IsTrue(oSimulator.CreateFolder("Root1.Sub1"));
Assert.IsTrue(oSimulator.CreateFolder("Root1.Sub2"));
Assert.IsTrue(oSimulator.CreateFolder("Root1.Sub3"));
Assert.IsTrue(oSimulator.SelectFolder("Root1"));
Assert.IsTrue(oSimulator.SelectFolder("Root1.Sub1"));
Assert.IsTrue(oSimulator.SelectFolder("Root1.Sub2"));
Assert.IsTrue(oSimulator.SelectFolder("Root1.Sub3"));
Assert.IsTrue(oSimulator.RenameFolder("Root1", "Root2"));
Assert.IsTrue(oSimulator.SelectFolder("Root2"));
Assert.IsTrue(oSimulator.SelectFolder("Root2.Sub1"));
Assert.IsTrue(oSimulator.SelectFolder("Root2.Sub2"));
Assert.IsTrue(oSimulator.SelectFolder("Root2.Sub3"));
oSimulator.Disconnect();
}
示例13: TestList
public void TestList()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
string result = oSimulator.Send("A01 LIST \"\" \"*\"\r\n").Substring(0, 1);
Assert.AreEqual("*", result);
}
示例14: TestLsubInclusion
public void TestLsubInclusion()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
string folderName = "Folder1";
var oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(oAccount.Address, "test");
CustomAssert.IsTrue(oSimulator.CreateFolder(folderName));
CustomAssert.IsFalse(oSimulator.LSUB().Contains(folderName));
CustomAssert.IsTrue(oSimulator.Subscribe(folderName));
CustomAssert.IsTrue(oSimulator.LSUB().Contains(folderName));
oSimulator.Disconnect();
}
示例15: TestFolderLSUBUnsubscribedFolder
public void TestFolderLSUBUnsubscribedFolder()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
const string folderName = "ABC.def.GHI";
var oSimulator = new IMAPSimulator();
oSimulator.Connect();
oSimulator.Logon(oAccount.Address, "test");
CustomAssert.IsTrue(oSimulator.CreateFolder(folderName));
CustomAssert.IsFalse(oSimulator.LSUB().Contains("\r\n\r\n"));
oSimulator.Disconnect();
}