本文整理汇总了C#中RegressionTests.Shared.IMAPClientSimulator.CreateFolder方法的典型用法代码示例。如果您正苦于以下问题:C# IMAPClientSimulator.CreateFolder方法的具体用法?C# IMAPClientSimulator.CreateFolder怎么用?C# IMAPClientSimulator.CreateFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RegressionTests.Shared.IMAPClientSimulator
的用法示例。
在下文中一共展示了IMAPClientSimulator.CreateFolder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestCreateFolderWithHash
public void TestCreateFolderWithHash()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPClientSimulator();
oSimulator.Connect();
oSimulator.Logon(oAccount.Address, "test");
CustomAssert.IsFalse(oSimulator.CreateFolder("#Test"));
CustomAssert.IsTrue(oSimulator.CreateFolder("Test.#Testar"));
oSimulator.Disconnect();
}
示例2: TestIMAPServer
public void TestIMAPServer()
{
TestSetup.DeleteCurrentDefaultLog();
Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
for (int i = 0; i < 30; i++)
{
try
{
var imapSim = new IMAPClientSimulator(true, 14301);
imapSim.ConnectAndLogon(account.Address, "test");
CustomAssert.IsTrue(imapSim.SelectFolder("Inbox"), "SelectInbox");
imapSim.CreateFolder("Test");
CustomAssert.IsTrue(imapSim.SelectFolder("Test"), "SelectTest");
CustomAssert.IsTrue(imapSim.Logout(), "Logout");
imapSim.Disconnect();
break;
}
catch (Exception)
{
if (i == 29)
throw;
}
}
}
示例3: TestCreateFolderWithSlash
public void TestCreateFolderWithSlash()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
const string folderName = "ABC\\123";
var oSimulator = new IMAPClientSimulator();
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();
}
示例4: 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 IMAPClientSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(account.Address, "test");
CustomAssert.IsTrue(oSimulator.CreateFolder(folderName));
string listResponse = oSimulator.List();
CustomAssert.IsTrue(listResponse.Contains("\"Test\\Test\""));
CustomAssert.IsTrue(listResponse.Contains("\"Test\""));
oSimulator.Disconnect();
}
示例5: TestAppendFolderNameInOctet
public void TestAppendFolderNameInOctet()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPClientSimulator();
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();
CustomAssert.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();
CustomAssert.IsTrue(result.StartsWith("+ Ready for literal data"));
oSimulator.SendRaw("WOOOT\r\n");
result = oSimulator.Receive();
CustomAssert.AreEqual("A01 OK APPEND completed\r\n", result);
}
示例6: TestFolderLSUBUnsubscribedFolder
public void TestFolderLSUBUnsubscribedFolder()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
const string folderName = "ABC.def.GHI";
var oSimulator = new IMAPClientSimulator();
oSimulator.Connect();
oSimulator.Logon(oAccount.Address, "test");
CustomAssert.IsTrue(oSimulator.CreateFolder(folderName));
CustomAssert.IsFalse(oSimulator.LSUB().Contains("\r\n\r\n"));
oSimulator.Disconnect();
}
示例7: TestListCommandChangedHierarchyDelimiter
public void TestListCommandChangedHierarchyDelimiter()
{
Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
_settings.IMAPHierarchyDelimiter = "\\";
var oSimulator = new IMAPClientSimulator();
oSimulator.Connect();
oSimulator.LogonWithLiteral(account.Address, "test");
oSimulator.CreateFolder("Test\\HelloWorld\\Test2");
string response = oSimulator.List("%");
CustomAssert.IsTrue(response.Contains("\"Test\""), response);
response = oSimulator.List("%\\%");
CustomAssert.IsTrue(response.Contains("\"Test\\HelloWorld\""), response);
response = oSimulator.List("%\\%\\%%");
CustomAssert.IsTrue(response.Contains("\"Test\\HelloWorld\\Test2\""), response);
}
示例8: TestSetACLOnAccountFolder
public void TestSetACLOnAccountFolder()
{
Application application = SingletonProvider<TestSetup>.Instance.GetApp();
Account account1 = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
Account account2 = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator1 = new IMAPClientSimulator();
oSimulator1.Connect();
oSimulator1.LogonWithLiteral(account1.Address, "test");
CustomAssert.IsTrue(oSimulator1.CreateFolder("SharedFolder"));
CustomAssert.IsFalse(oSimulator1.SetACL("SharedFolder", account2.Address, "lrswipkxtea"));
oSimulator1.Disconnect();
}
示例9: TestFolderCaseInLSUB
public void TestFolderCaseInLSUB()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
string folderName = "ABC.def.GHI";
var oSimulator = new IMAPClientSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon(oAccount.Address, "test");
CustomAssert.IsTrue(oSimulator.CreateFolder(folderName));
CustomAssert.IsTrue(oSimulator.Subscribe(folderName));
CustomAssert.IsFalse(oSimulator.LSUB("ABC.DEF.*").Contains("ABC.def.GHI"));
CustomAssert.IsTrue(oSimulator.LSUB("ABC.DEF.*").Contains("ABC.DEF.GHI"));
CustomAssert.IsFalse(oSimulator.LSUB("ABC.def.*").Contains("ABC.DEF"));
CustomAssert.IsTrue(oSimulator.LSUB("ABC.def.*").Contains("ABC.def.GHI"));
CustomAssert.IsTrue(oSimulator.SelectFolder(folderName));
oSimulator.Disconnect();
}
示例10: TestRenameLongFolder
public void TestRenameLongFolder()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPClientSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.LogonWithLiteral(oAccount.Address, "test");
CustomAssert.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"));
CustomAssert.IsTrue(oSimulator.CreateFolder("A"));
CustomAssert.IsFalse(oSimulator.RenameFolder("1", "A.1"));
CustomAssert.IsTrue(oSimulator.RenameFolder("1.2.3", "A.1"));
CustomAssert.IsTrue(oSimulator.SelectFolder("A.1.4"));
oSimulator.Disconnect();
}
示例11: TestRenameToParallelFolder
public void TestRenameToParallelFolder()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPClientSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.LogonWithLiteral(oAccount.Address, "test");
CustomAssert.IsTrue(oSimulator.CreateFolder("Main.Sub"));
CustomAssert.IsTrue(oSimulator.RenameFolder("Main.Sub", "Second.Sub"));
string listResponse = oSimulator.List();
CustomAssert.IsFalse(listResponse.Contains("Main.Sub"));
CustomAssert.IsTrue(listResponse.Contains("Second.Sub"));
oSimulator.Disconnect();
}
示例12: TestPublicFolderCreateDeep
public void TestPublicFolderCreateDeep()
{
Application application = SingletonProvider<TestSetup>.Instance.GetApp();
Account account1 = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPFolders publicFolders = _settings.PublicFolders;
IMAPFolder folder = publicFolders.Add("Share1");
folder.Save();
IMAPFolderPermission permission = folder.Permissions.Add();
permission.PermissionAccountID = account1.ID;
permission.PermissionType = eACLPermissionType.ePermissionTypeUser;
permission.set_Permission(eACLPermission.ePermissionCreate, true);
permission.set_Permission(eACLPermission.ePermissionRead, true);
permission.set_Permission(eACLPermission.ePermissionLookup, true);
permission.Save();
var oSimulator1 = new IMAPClientSimulator();
oSimulator1.Connect();
oSimulator1.Logon(account1.Address, "test");
string folderName = "#Public.Share1.MySub1.MySub2.MySub3.MySub4";
CustomAssert.IsTrue(oSimulator1.CreateFolder(folderName));
oSimulator1.Disconnect();
}
示例13: TestLsubInclusion
public void TestLsubInclusion()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
string folderName = "Folder1";
var oSimulator = new IMAPClientSimulator();
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();
}
示例14: TestCreateRootSharedFolder
public void TestCreateRootSharedFolder()
{
Application application = SingletonProvider<TestSetup>.Instance.GetApp();
Account account1 = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
Account account2 = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator1 = new IMAPClientSimulator();
oSimulator1.Connect();
oSimulator1.Logon(account1.Address, "test");
CustomAssert.IsFalse(oSimulator1.CreateFolder("#Public.SharedFolder"));
oSimulator1.Disconnect();
}
示例15: TestDeleteSubFolderCheckAPI
public void TestDeleteSubFolderCheckAPI()
{
Application application = SingletonProvider<TestSetup>.Instance.GetApp();
IMAPFolders publicFolders = _settings.PublicFolders;
CustomAssert.AreEqual(0, publicFolders.Count);
Account account1 = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPFolder folder = publicFolders.Add("Share1");
folder.Save();
CustomAssert.AreEqual(1, publicFolders.Count);
IMAPFolders mySubFolders = folder.SubFolders;
CustomAssert.AreEqual(0, mySubFolders.Count);
IMAPFolderPermission permission = folder.Permissions.Add();
permission.PermissionAccountID = account1.ID;
permission.PermissionType = eACLPermissionType.ePermissionTypeUser;
permission.set_Permission(eACLPermission.ePermissionCreate, true);
permission.set_Permission(eACLPermission.ePermissionRead, true);
permission.set_Permission(eACLPermission.ePermissionLookup, true);
permission.Save();
var oSimulator1 = new IMAPClientSimulator();
oSimulator1.ConnectAndLogon("[email protected]", "test");
CustomAssert.IsTrue(oSimulator1.CreateFolder("#public.Share1.MySub"));
CustomAssert.AreEqual(1, mySubFolders.Count);
permission.set_Permission(eACLPermission.ePermissionDeleteMailbox, true);
permission.Save();
CustomAssert.IsTrue(oSimulator1.DeleteFolder("#public.Share1.MySub"));
CustomAssert.IsFalse(oSimulator1.SelectFolder("#public.Share1.MySub"));
CustomAssert.AreEqual(0, mySubFolders.Count);
CustomAssert.AreEqual(1, publicFolders.Count);
oSimulator1.Disconnect();
}