本文整理汇总了C#中ImapPseudoServer.EnqueueTaggedResponse方法的典型用法代码示例。如果您正苦于以下问题:C# ImapPseudoServer.EnqueueTaggedResponse方法的具体用法?C# ImapPseudoServer.EnqueueTaggedResponse怎么用?C# ImapPseudoServer.EnqueueTaggedResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImapPseudoServer
的用法示例。
在下文中一共展示了ImapPseudoServer.EnqueueTaggedResponse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveToNewNameSubscribeCanNotHaveChild
private void MoveToNewNameSubscribeCanNotHaveChild(ImapPseudoServer server, ImapMailboxInfo mailbox)
{
// RENAME
server.EnqueueTaggedResponse("$tag OK done\r\n");
// UNSUBSCRIBE
server.EnqueueTaggedResponse("$tag OK done\r\n");
// SUBSCRIBE
server.EnqueueTaggedResponse("$tag OK done\r\n");
mailbox.MoveTo("OldSent", true);
Assert.That(server.DequeueRequest(), Text.EndsWith("RENAME \"Sent\" \"OldSent\"\r\n"));
Assert.That(server.DequeueRequest(), Text.EndsWith("UNSUBSCRIBE \"Sent\"\r\n"));
Assert.That(server.DequeueRequest(), Text.EndsWith("SUBSCRIBE \"OldSent\"\r\n"));
}
示例2: TestDisposeAsyncConnectRunning
public void TestDisposeAsyncConnectRunning()
{
using (var server = new ImapPseudoServer()) {
server.Start();
using (var client = new ImapClient(server.Host, server.Port, "user")) {
client.Profile.AllowInsecureLogin = true;
client.Profile.Timeout = 5000;
Assert.IsFalse(client.IsConnected);
var asyncResult = (ImapClient.ConnectAsyncResult)client.BeginConnect("pass");
// greeting
server.EnqueueResponse("* OK [CAPABILITY IMAP4rev1] ImapPseudoServer ready\r\n");
// LOGIN
server.EnqueueTaggedResponse("* CAPABILITY IMAP4rev1\r\n" +
"$tag OK done\r\n");
Assert.IsFalse(asyncResult.EndConnectCalled);
((IDisposable)client).Dispose();
StringAssert.Contains("LOGIN user pass", server.DequeueRequest());
Assert.IsFalse(client.IsConnected);
client.EndConnect(asyncResult);
Assert.IsTrue(asyncResult.EndConnectCalled);
Assert.IsFalse(client.IsConnected);
}
}
}
示例3: MoveToDestinationMailboxDestinationCanNotHaveChild
private void MoveToDestinationMailboxDestinationCanNotHaveChild(ImapPseudoServer server, ImapMailboxInfo destMailbox)
{
// LIST
server.EnqueueTaggedResponse("* LIST () \"/\" src\r\n" +
"$tag OK done\r\n");
var sourceMailbox = destMailbox.Client.GetMailbox("src");
Assert.That(server.DequeueRequest(), Text.EndsWith("LIST \"\" \"src\"\r\n"));
sourceMailbox.MoveTo(destMailbox);
}