本文整理汇总了C#中IMAPSimulator.Send方法的典型用法代码示例。如果您正苦于以下问题:C# IMAPSimulator.Send方法的具体用法?C# IMAPSimulator.Send怎么用?C# IMAPSimulator.Send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMAPSimulator
的用法示例。
在下文中一共展示了IMAPSimulator.Send方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestIMAPServerLiteral
public void TestIMAPServerLiteral()
{
IMAPSimulator sim = new IMAPSimulator();
sim.Connect();
Assert.IsTrue(sim.Send("a01 login " + GetUsername() + " {4}").StartsWith("+"));
sim.Send(GetPassword());
EnsureNoPassword();
}
示例2: TestCreateDeepFolder
public void TestCreateDeepFolder()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.LogonWithLiteral(oAccount.Address, "test");
string result = oSimulator.Send("A01 CREATE 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26");
Assert.IsTrue(result.Contains("A01 NO"));
oSimulator.Disconnect();
}
示例3: TestHierarchyDelimiterNamespaceResponse
public void TestHierarchyDelimiterNamespaceResponse()
{
hMailServer.Application application = SingletonProvider<Utilities>.Instance.GetApp();
hMailServer.Settings settings = _settings;
settings.IMAPHierarchyDelimiter = "\\";
string publicFolderName = _settings.IMAPPublicFolderName;
hMailServer.Account account = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
oSimulator.ConnectAndLogon(account.Address, "test");
string result = oSimulator.Send("A01 NAMESPACE");
string correctNamespaceSetting = "* NAMESPACE ((\"\" \"\\\\\")) NIL ((\"" + publicFolderName + "\" \"\\\\\"))";
Assert.IsTrue(result.Contains(correctNamespaceSetting), result);
oSimulator.Disconnect();
settings.IMAPHierarchyDelimiter = ".";
oSimulator = new IMAPSimulator();
oSimulator.ConnectAndLogon(account.Address, "test");
result = oSimulator.Send("A01 NAMESPACE");
correctNamespaceSetting = "* NAMESPACE ((\"\" \".\")) NIL ((\"" + publicFolderName + "\" \".\"))";
Assert.IsTrue(result.Contains(correctNamespaceSetting), result);
oSimulator.Disconnect();
settings.IMAPHierarchyDelimiter = "/";
oSimulator = new IMAPSimulator();
oSimulator.ConnectAndLogon(account.Address, "test");
result = oSimulator.Send("A01 NAMESPACE");
correctNamespaceSetting = "* NAMESPACE ((\"\" \"/\")) NIL ((\"" + publicFolderName + "\" \"/\"))";
Assert.IsTrue(result.Contains(correctNamespaceSetting), result);
oSimulator.Disconnect();
}
示例4: TestCreateLongFolder
public void TestCreateLongFolder()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.LogonWithLiteral(oAccount.Address, "test");
string folderName = "";
for (int i = 0; i < 255; i++)
folderName = folderName + "A";
string result = oSimulator.Send("A01 CREATE " + folderName);
Assert.IsTrue(result.Contains("A01 OK"));
Assert.IsTrue(oSimulator.SelectFolder(folderName));
folderName = "";
for (int i = 0; i < 256; i++)
folderName = folderName + "A";
result = oSimulator.Send("A01 CREATE " + folderName);
Assert.IsTrue(result.Contains("A01 NO"));
Assert.IsFalse(oSimulator.SelectFolder(folderName));
oSimulator.Disconnect();
}
示例5: TestRenameToAndFromINBOX
public void TestRenameToAndFromINBOX()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.LogonWithLiteral(oAccount.Address, "test");
oSimulator.Send("A01 CREATE A\r\n");
Assert.IsFalse(oSimulator.RenameFolder("A", "INBOX"));
Assert.IsFalse(oSimulator.RenameFolder("INBOX", "B"));
oSimulator.Disconnect();
}
示例6: TestRenameIncorrectParameters
public void TestRenameIncorrectParameters()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "fold[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.LogonWithLiteral(oAccount.Address, "test");
string result = oSimulator.Send("A01 CREATE A");
result = oSimulator.Send("A02 RENAME A B C");
Assert.IsTrue(result.Contains("A02 BAD"));
oSimulator.Disconnect();
}
示例7: TestCreateUnnamedSubFolder
public void TestCreateUnnamedSubFolder()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.LogonWithLiteral(oAccount.Address, "test");
string result = oSimulator.Send("A01 CREATE 1..3");
Assert.IsTrue(result.Contains("A01 NO"));
result = oSimulator.Send("A01 CREATE 1....3");
Assert.IsTrue(result.Contains("A01 NO"));
result = oSimulator.Send("A01 CREATE 1.......3");
Assert.IsTrue(result.Contains("A01 NO"));
oSimulator.Disconnect();
}
示例8: TestSearchORWithLiterals3
public void TestSearchORWithLiterals3()
{
hMailServer.Application application = SingletonProvider<Utilities>.Instance.GetApp();
;
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);
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"));
string result = oSimulator.Send("A01 SEARCH ALL OR (HEADER SUBJECT {5}");
result = oSimulator.Send("Test5) (HEADER SUBJECT {5}");
result = oSimulator.Send("Test2)");
Assert.IsTrue(result.StartsWith("* SEARCH 2"));
}
示例9: TestLiterals
public void TestLiterals()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
string result = oSimulator.Send("A01 CREATE {4}");
result = oSimulator.Send("HEJS");
oSimulator.Disconnect();
}
示例10: TestList
public void TestList()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator 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);
}
示例11: TestFolderNamesWithUnicodeChars
public void TestFolderNamesWithUnicodeChars()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.LogonWithLiteral("[email protected]", "test");
oSimulator.Send("A01 CREATE &AMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQ-\r\n");
oSimulator.Disconnect();
string s = oAccount.IMAPFolders[1].Name;
Assert.AreEqual("ÄÄÄÄÄÄÄÄÄÄÄÄÄ", s);
}
示例12: TestOutOfBounds
public void TestOutOfBounds()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
string s = oSimulator.Send("A01 RENAME TEST");
if (s.StartsWith("A01 BAD") == false)
throw new Exception("ERROR - Out of bounds test failed");
}
示例13: TestNamespace
public void TestNamespace()
{
string imapFolderName = _settings.IMAPPublicFolderName;
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator 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");
}
}