本文整理汇总了C#中IMAPSimulator.CreateFolder方法的典型用法代码示例。如果您正苦于以下问题:C# IMAPSimulator.CreateFolder方法的具体用法?C# IMAPSimulator.CreateFolder怎么用?C# IMAPSimulator.CreateFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMAPSimulator
的用法示例。
在下文中一共展示了IMAPSimulator.CreateFolder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestCreateFolderWithHash
public void TestCreateFolderWithHash()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(oAccount.Address, "test");
Assert.IsFalse(oSimulator.CreateFolder("#Test"));
Assert.IsTrue(oSimulator.CreateFolder("Test.#Testar"));
oSimulator.Disconnect();
}
示例2: TestCreateFolderWithSlash
public void TestCreateFolderWithSlash()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
string folderName = "ABC\\123";
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(oAccount.Address, "test");
Assert.IsTrue(oSimulator.CreateFolder(folderName));
Assert.IsTrue(oSimulator.List().Contains(folderName));
Assert.IsTrue(oSimulator.SelectFolder(folderName));
oSimulator.Disconnect();
}
示例3: TestHierarchyDelimiterListResponse
public void TestHierarchyDelimiterListResponse()
{
hMailServer.Application application = SingletonProvider<Utilities>.Instance.GetApp();
hMailServer.Settings settings = _settings;
settings.IMAPHierarchyDelimiter = "\\";
hMailServer.Account account = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
string folderName = "Test\\Test";
IMAPSimulator 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();
}
示例4: TestAppendFolderNameInOctet
public void TestAppendFolderNameInOctet()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator 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);
}
示例5: TestFolderCaseInLSUB
public void TestFolderCaseInLSUB()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
string folderName = "ABC.def.GHI";
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(oAccount.Address, "test");
Assert.IsTrue(oSimulator.CreateFolder(folderName));
Assert.IsTrue(oSimulator.Subscribe(folderName));
Assert.IsFalse(oSimulator.LSUB("ABC.DEF.*").Contains("ABC.def.GHI"));
Assert.IsTrue(oSimulator.LSUB("ABC.DEF.*").Contains("ABC.DEF.GHI"));
Assert.IsFalse(oSimulator.LSUB("ABC.def.*").Contains("ABC.DEF"));
Assert.IsTrue(oSimulator.LSUB("ABC.def.*").Contains("ABC.def.GHI"));
Assert.IsTrue(oSimulator.SelectFolder(folderName));
oSimulator.Disconnect();
}
示例6: TestDeleteIMAPFolderNotifications
public void TestDeleteIMAPFolderNotifications()
{
_settings.IMAPIdleEnabled = true;
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator1 = new IMAPSimulator();
IMAPSimulator oSimulator2 = new IMAPSimulator();
oSimulator1.ConnectAndLogon(oAccount.Address, "test");
oSimulator2.ConnectAndLogon(oAccount.Address, "test");
oSimulator1.SelectFolder("Inbox");
oSimulator2.CreateFolder("Mailbox");
oSimulator2.DeleteFolder("Mailbox");
SMTPClientSimulator.StaticSend("[email protected]", oAccount.Address, "Test", "test");
POP3Simulator.AssertMessageCount(oAccount.Address, "test", 1);
string noopResponse = oSimulator1.NOOP() + oSimulator1.NOOP();
// confirm that the client is notified about this message even though another
// folder has been dropped by another client.
Assert.IsTrue(noopResponse.Contains(@"* 1 EXISTS"), noopResponse);
}
示例7: TestAppendFolderNameInOctetNoFlagList
public void TestAppendFolderNameInOctetNoFlagList()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator 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 \"12-Jan-2009 12:12:12 +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);
DateTime date = Convert.ToDateTime(oAccount.IMAPFolders.get_ItemByName("MONK").Messages[0].InternalDate);
Assert.AreEqual(2009, date.Year);
Assert.AreEqual(12, date.Day);
Assert.AreEqual(1, date.Month);
}
示例8: TestRenameToParallelFolder
public void TestRenameToParallelFolder()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.LogonWithLiteral(oAccount.Address, "test");
Assert.IsTrue(oSimulator.CreateFolder("Main.Sub"));
Assert.IsTrue(oSimulator.RenameFolder("Main.Sub", "Second.Sub"));
string listResponse = oSimulator.List();
Assert.IsFalse(listResponse.Contains("Main.Sub"));
Assert.IsTrue(listResponse.Contains("Second.Sub"));
oSimulator.Disconnect();
}
示例9: TestCreateRootSharedFolder
public void TestCreateRootSharedFolder()
{
hMailServer.Application application = SingletonProvider<Utilities>.Instance.GetApp();
hMailServer.Account account1 = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
hMailServer.Account account2 = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator1 = new IMAPSimulator();
oSimulator1.Connect();
oSimulator1.Logon(account1.Address, "test");
Assert.IsFalse(oSimulator1.CreateFolder("#Public.SharedFolder"));
oSimulator1.Disconnect();
}
示例10: TestLsubInclusion
public void TestLsubInclusion()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
string folderName = "Folder1";
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(oAccount.Address, "test");
Assert.IsTrue(oSimulator.CreateFolder(folderName));
Assert.IsFalse(oSimulator.LSUB().Contains(folderName));
Assert.IsTrue(oSimulator.Subscribe(folderName));
Assert.IsTrue(oSimulator.LSUB().Contains(folderName));
oSimulator.Disconnect();
}
示例11: TestRenameLongFolder
public void TestRenameLongFolder()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.LogonWithLiteral(oAccount.Address, "test");
Assert.IsTrue(oSimulator.CreateFolder("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"));
Assert.IsTrue(oSimulator.CreateFolder("A"));
Assert.IsFalse(oSimulator.RenameFolder("1", "A.1"));
Assert.IsTrue(oSimulator.RenameFolder("1.2.3", "A.1"));
Assert.IsTrue(oSimulator.SelectFolder("A.1.4"));
oSimulator.Disconnect();
}
示例12: TestRenameAndList5
public void TestRenameAndList5()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
oSimulator.CreateFolder("Root1");
oSimulator.CreateFolder("Root2.Root3");
oSimulator.RenameFolder("Root2.Root3", "Root2.Root4");
oSimulator.RenameFolder("Root1", "Root2.Root4.Root1");
string result = oSimulator.List();
Assert.IsFalse(result.Contains(" Root1\r\n"));
Assert.IsTrue(result.Contains("Root2.Root4.Root1\"\r\n"));
Assert.IsFalse(oSimulator.SelectFolder("Root1"));
Assert.IsTrue(oSimulator.SelectFolder("Root2.Root4.Root1"));
oSimulator.Disconnect();
}
示例13: TestUnseenResponseInSelect
public void TestUnseenResponseInSelect()
{
hMailServer.Account account = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "TestMessage");
IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);
IMAPSimulator sim = new IMAPSimulator();
Assert.IsTrue(sim.ConnectAndLogon(account.Address, "test"));
Assert.IsTrue(sim.SelectFolder("Inbox"));
Assert.IsTrue(sim.CreateFolder("Dummy"));
Assert.IsTrue(sim.Copy(1, "Dummy"));
string result = sim.SendSingleCommand("a01 select Dummy");
Assert.IsTrue(result.Contains("* 1 EXISTS\r\n* 1 RECENT"), result);
string searchResponse = sim.SendSingleCommand("srch1 SEARCH ALL UNSEEN");
// We should have at least one message here.
Assert.IsTrue(searchResponse.Contains("* SEARCH 1\r\n"), searchResponse);
// Now fetch the body.
string bodyText = sim.Fetch("1 BODY[TEXT]");
// Now the message is no longer unseen. Confirm this.
searchResponse = sim.SendSingleCommand("srch1 SEARCH ALL UNSEEN");
Assert.IsTrue(searchResponse.Contains("* SEARCH\r\n"), searchResponse);
// Close the messages to mark them as no longer recent.
Assert.IsTrue(sim.Close());
result = sim.SendSingleCommand("a01 select Dummy");
Assert.IsTrue(result.Contains("* 1 EXISTS\r\n* 0 RECENT"), result);
}
示例14: TestRecentRemovedOnMailboxClose
public void TestRecentRemovedOnMailboxClose()
{
hMailServer.Account account = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "TestMessage");
IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);
IMAPSimulator sim = new IMAPSimulator();
Assert.IsTrue(sim.ConnectAndLogon(account.Address, "test"));
Assert.IsTrue(sim.SelectFolder("Inbox"));
Assert.IsTrue(sim.CreateFolder("Dummy"));
Assert.IsTrue(sim.Copy(1, "Dummy"));
string result = sim.SendSingleCommand("a01 select Dummy");
Assert.IsTrue(result.Contains("* 1 EXISTS\r\n* 1 RECENT"), result);
Assert.IsTrue(sim.Logout());
sim = new IMAPSimulator();
Assert.IsTrue(sim.ConnectAndLogon(account.Address, "test"));
result = sim.SendSingleCommand("a01 select Dummy");
Assert.IsFalse(result.Contains("* 1 EXISTS\r\n* 1 RECENT"), result);
Assert.IsTrue(sim.Logout());
}
示例15: TestRename
public void TestRename()
{
hMailServer.Application application = SingletonProvider<Utilities>.Instance.GetApp();
;
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator 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();
}