本文整理汇总了C#中RegressionTests.Shared.ImapClientSimulator.Send方法的典型用法代码示例。如果您正苦于以下问题:C# ImapClientSimulator.Send方法的具体用法?C# ImapClientSimulator.Send怎么用?C# ImapClientSimulator.Send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RegressionTests.Shared.ImapClientSimulator
的用法示例。
在下文中一共展示了ImapClientSimulator.Send方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestBatchOfCommands
public void TestBatchOfCommands()
{
Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
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);
Assert.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);
Assert.IsFalse(result.StartsWith("* BYE Excessive number of buffered commands"));
oSimulator.Disconnect();
}
示例2: TestIMAPServerLiteral
public void TestIMAPServerLiteral()
{
var sim = new ImapClientSimulator();
sim.Connect();
Assert.IsTrue(sim.Send("a01 login " + GetUsername() + " {4}").StartsWith("+"));
sim.Send(GetPassword());
EnsureNoPassword();
}
示例3: TestCreateDeepFolder
public void TestCreateDeepFolder()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
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();
}
示例4: TestLongCommand
public void TestLongCommand()
{
Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
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);
Assert.IsTrue(result.Length == 0 || result.StartsWith("A01"));
}
示例5: TestFolderNamesWithUnicodeChars
public void TestFolderNamesWithUnicodeChars()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.LogonWithLiteral("[email protected]", "test");
oSimulator.Send("A50 CREATE &AMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQ-\r\n");
oSimulator.Disconnect();
string s = oAccount.IMAPFolders[1].Name;
Assert.AreEqual("ÄÄÄÄÄÄÄÄÄÄÄÄÄ", s);
}
示例6: TestOutOfBounds
public void TestOutOfBounds()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
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");
}
示例7: TestNamespace
public void TestNamespace()
{
string imapFolderName = _settings.IMAPPublicFolderName;
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
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");
}
}
示例8: TestLiterals
public void TestLiterals()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
string result = oSimulator.Send("A01 CREATE {4}");
result = oSimulator.Send("HEJS");
oSimulator.Disconnect();
}
示例9: TestList
public void TestList()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
string result = oSimulator.Send("A01 LIST \"\" \"*\"\r\n").Substring(0, 1);
Assert.AreEqual("*", result);
}
示例10: TestCreateLongFolder
public void TestCreateLongFolder()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
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();
}
示例11: TestRenameToAndFromINBOX
public void TestRenameToAndFromINBOX()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
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();
}
示例12: TestRenameIncorrectParameters
public void TestRenameIncorrectParameters()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
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();
}
示例13: TestCreateUnnamedSubFolder
public void TestCreateUnnamedSubFolder()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var simulator = new ImapClientSimulator();
simulator.Connect();
simulator.LogonWithLiteral(oAccount.Address, "test");
string result = simulator.Send("A01 CREATE 1..3");
Assert.IsTrue(result.Contains("A01 NO"));
result = simulator.Send("A01 CREATE 1....3");
Assert.IsTrue(result.Contains("A01 NO"));
result = simulator.Send("A01 CREATE 1.......3");
Assert.IsTrue(result.Contains("A01 NO"));
simulator.Disconnect();
}
示例14: TestHierarchyDelimiterNamespaceResponse
public void TestHierarchyDelimiterNamespaceResponse()
{
Application application = SingletonProvider<TestSetup>.Instance.GetApp();
Settings settings = _settings;
settings.IMAPHierarchyDelimiter = "\\";
string publicFolderName = _settings.IMAPPublicFolderName;
Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new ImapClientSimulator();
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 ImapClientSimulator();
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 ImapClientSimulator();
oSimulator.ConnectAndLogon(account.Address, "test");
result = oSimulator.Send("A01 NAMESPACE");
correctNamespaceSetting = "* NAMESPACE ((\"\" \"/\")) NIL ((\"" + publicFolderName + "\" \"/\"))";
Assert.IsTrue(result.Contains(correctNamespaceSetting), result);
oSimulator.Disconnect();
}
示例15: TestSearchORWithLiterals3
public void TestSearchORWithLiterals3()
{
Application application = SingletonProvider<TestSetup>.Instance.GetApp();
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);
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"));
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"));
}