本文整理汇总了C#中RegressionTests.Shared.IMAPClientSimulator.RenameFolder方法的典型用法代码示例。如果您正苦于以下问题:C# IMAPClientSimulator.RenameFolder方法的具体用法?C# IMAPClientSimulator.RenameFolder怎么用?C# IMAPClientSimulator.RenameFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RegressionTests.Shared.IMAPClientSimulator
的用法示例。
在下文中一共展示了IMAPClientSimulator.RenameFolder方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestTryCreateInvalidStructure
public void TestTryCreateInvalidStructure()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPClientSimulator();
oSimulator.Connect();
oSimulator.LogonWithLiteral(oAccount.Address, "test");
CustomAssert.IsTrue(oSimulator.CreateFolder("1.2.3"));
CustomAssert.IsTrue(oSimulator.CreateFolder("1.2.3.4"));
// Should fail because name taken.
CustomAssert.IsFalse(oSimulator.RenameFolder("1.2.3.4", "1.2.3"));
CustomAssert.IsFalse(oSimulator.RenameFolder("1.2.3.4", "1.2"));
CustomAssert.IsFalse(oSimulator.RenameFolder("1.2.3.4", "1"));
// Should fail because invalid destination name.
CustomAssert.IsFalse(oSimulator.RenameFolder("1.2.3.4", ""));
// Should fail because destination name taken.
CustomAssert.IsFalse(oSimulator.RenameFolder("1.2.3", "1.2.3.4"));
CustomAssert.IsFalse(oSimulator.RenameFolder("1.2", "1.2.3.4"));
CustomAssert.IsFalse(oSimulator.RenameFolder("1", "1.2.3.4"));
CustomAssert.IsFalse(oSimulator.RenameFolder("1.2.3", "1.2"));
CustomAssert.IsFalse(oSimulator.RenameFolder("1.2.3", "1"));
CustomAssert.IsTrue(oSimulator.RenameFolder("1.2.3", "A"));
oSimulator.Disconnect();
}
示例2: 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();
}
示例3: TestRenameToSubFolder
public void TestRenameToSubFolder()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPClientSimulator();
oSimulator.Connect();
oSimulator.LogonWithLiteral(oAccount.Address, "test");
CustomAssert.IsTrue(oSimulator.CreateFolder("1.2.3.4.5"));
CustomAssert.IsTrue(oSimulator.CreateFolder("A"));
CustomAssert.IsTrue(oSimulator.RenameFolder("1", "A.1"));
CustomAssert.IsTrue(oSimulator.SelectFolder("A.1"));
CustomAssert.IsTrue(oSimulator.SelectFolder("A.1.2.3.4.5"));
CustomAssert.IsTrue(oSimulator.RenameFolder("A.1", "1"));
CustomAssert.IsFalse(oSimulator.SelectFolder("A.1"));
CustomAssert.IsFalse(oSimulator.SelectFolder("A.1.2.3.4.5"));
CustomAssert.IsTrue(oSimulator.SelectFolder("1"));
CustomAssert.IsTrue(oSimulator.SelectFolder("1.2.3.4.5"));
oSimulator.Disconnect();
}
示例4: TestRenameSubFolderToMatchingName
public void TestRenameSubFolderToMatchingName()
{
Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPClientSimulator();
CustomAssert.IsTrue(oSimulator.ConnectAndLogon(account.Address, "test"));
CustomAssert.IsTrue(oSimulator.CreateFolder("Folder1"));
CustomAssert.IsTrue(oSimulator.SelectFolder("Folder1"));
string result = string.Empty;
CustomAssert.IsFalse(oSimulator.RenameFolder("Folder1", "Folder1.Sub1", out result));
CustomAssert.IsTrue(result.Contains("A folder cannot be moved into one of its subfolders."));
CustomAssert.IsTrue(oSimulator.SelectFolder("Folder1"));
result = string.Empty;
CustomAssert.IsTrue(oSimulator.RenameFolder("Folder1", "Folder1Test", out result));
CustomAssert.IsTrue(oSimulator.SelectFolder("Folder1Test"));
oSimulator.Disconnect();
}
示例5: 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");
CustomAssert.IsFalse(oSimulator.RenameFolder("A", "INBOX"));
CustomAssert.IsFalse(oSimulator.RenameFolder("INBOX", "B"));
oSimulator.Disconnect();
}
示例6: 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();
}
示例7: TestRenameRootPublicFolder
public void TestRenameRootPublicFolder()
{
IMAPFolders folders = _application.Settings.PublicFolders;
IMAPFolder folder = folders.Add("ShareA");
folder.Save();
IMAPFolderPermission permission = folder.Permissions.Add();
permission.PermissionType = eACLPermissionType.ePermissionTypeAnyone;
permission.set_Permission(eACLPermission.ePermissionLookup, true);
permission.set_Permission(eACLPermission.ePermissionRead, true);
permission.set_Permission(eACLPermission.ePermissionDeleteMailbox, true);
permission.Save();
IMAPFolder folder2 = folders.Add("ShareB");
folder2.Save();
IMAPFolderPermission permission2 = folder2.Permissions.Add();
permission2.PermissionType = eACLPermissionType.ePermissionTypeAnyone;
permission2.set_Permission(eACLPermission.ePermissionLookup, true);
permission2.set_Permission(eACLPermission.ePermissionRead, true);
permission2.set_Permission(eACLPermission.ePermissionDeleteMailbox, true);
permission2.Save();
Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var simulator1 = new IMAPClientSimulator();
simulator1.ConnectAndLogon(account.Address, "test");
CustomAssert.IsTrue(simulator1.SelectFolder("#Public.ShareA"));
CustomAssert.IsTrue(simulator1.SelectFolder("#Public.ShareB"));
CustomAssert.IsTrue(simulator1.RenameFolder("#Public.ShareA", "#Public.ShareB.ShareA"));
CustomAssert.IsFalse(simulator1.SelectFolder("#Public.ShareA"));
CustomAssert.IsTrue(simulator1.SelectFolder("#Public.ShareB"));
CustomAssert.IsTrue(simulator1.SelectFolder("#Public.ShareB.ShareA"));
}
示例8: TestRenameFolderToAndFromPublic
public void TestRenameFolderToAndFromPublic()
{
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.ePermissionDeleteMailbox, true);
permission.set_Permission(eACLPermission.ePermissionLookup, true);
permission.Save();
string oldFolderName = "#Public.Share1";
string newFolderName = "AccountLevelFolder";
// Test renaming from local folder name to shared folder.
var oSimulator1 = new IMAPClientSimulator();
oSimulator1.Connect();
oSimulator1.Logon(account1.Address, "test");
CustomAssert.IsFalse(oSimulator1.RenameFolder(oldFolderName, newFolderName));
oSimulator1.Disconnect();
// Test renaming from local folder name to shared folder.
oldFolderName = "LocalFolder";
newFolderName = "#Public.Share1";
oSimulator1 = new IMAPClientSimulator();
oSimulator1.Connect();
oSimulator1.Logon(account1.Address, "test");
oSimulator1.CreateFolder(oldFolderName);
CustomAssert.IsFalse(oSimulator1.RenameFolder(oldFolderName, newFolderName));
oSimulator1.Disconnect();
}
示例9: TestHierarchyDelimiterRename
public void TestHierarchyDelimiterRename()
{
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";
string newFolderName = "Apa/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("\"" + folderName + "\""));
CustomAssert.IsTrue(listResponse.Contains("\"Test\""));
CustomAssert.IsTrue(oSimulator.RenameFolder("Test", "Apa"));
listResponse = oSimulator.List();
CustomAssert.IsTrue(listResponse.Contains("\"" + newFolderName + "\""));
CustomAssert.IsTrue(listResponse.Contains("\"Apa\""));
oSimulator.Disconnect();
}
示例10: TestRenamePublicFolderToRootPublicFolder
public void TestRenamePublicFolderToRootPublicFolder()
{
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.ePermissionLookup, true);
permission.set_Permission(eACLPermission.ePermissionDeleteMailbox, true);
permission.Save();
string oldFolderName = "#Public.Share1.MySub1";
string newFolderName = "#Public.Share2";
var oSimulator1 = new IMAPClientSimulator();
oSimulator1.Connect();
oSimulator1.Logon(account1.Address, "test");
CustomAssert.IsTrue(oSimulator1.CreateFolder(oldFolderName));
CustomAssert.IsFalse(oSimulator1.RenameFolder(oldFolderName, newFolderName));
CustomAssert.IsTrue(oSimulator1.List().Contains(oldFolderName));
CustomAssert.IsFalse(oSimulator1.List().Contains(newFolderName));
oSimulator1.Disconnect();
}
示例11: TestBeforeLogon
public void TestBeforeLogon()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPClientSimulator();
string sWelcomeMessage = oSimulator.Connect();
CustomAssert.IsTrue(oSimulator.ExamineFolder("NonexistantFolder").Contains("NO Authenticate first"));
CustomAssert.IsFalse(oSimulator.SelectFolder("NonexistantFolder"));
CustomAssert.IsFalse(oSimulator.Copy(1, "SomeFolder"));
CustomAssert.IsFalse(oSimulator.CheckFolder("SomeFolder"));
CustomAssert.IsTrue(oSimulator.Fetch("123 a").Contains("NO Authenticate first"));
CustomAssert.IsTrue(oSimulator.List().Contains("NO Authenticate first"));
CustomAssert.IsTrue(oSimulator.LSUB().Contains("NO Authenticate first"));
CustomAssert.IsTrue(oSimulator.GetMyRights("APA").Contains("NO Authenticate first"));
CustomAssert.IsFalse(oSimulator.RenameFolder("A", "B"));
CustomAssert.IsFalse(oSimulator.Status("SomeFolder", "MESSAGES").Contains("A01 OK"));
}
示例12: TestRenameIMAPFolderNotifications
public void TestRenameIMAPFolderNotifications()
{
_settings.IMAPIdleEnabled = true;
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator1 = new IMAPClientSimulator();
var oSimulator2 = new IMAPClientSimulator();
oSimulator1.ConnectAndLogon(oAccount.Address, "test");
oSimulator2.ConnectAndLogon(oAccount.Address, "test");
oSimulator1.SelectFolder("Inbox");
oSimulator2.CreateFolder("Mailbox");
oSimulator2.RenameFolder("Mailbox", "Mailbox2");
SMTPClientSimulator.StaticSend("[email protected]", oAccount.Address, "Test", "test");
POP3ClientSimulator.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.
CustomAssert.IsTrue(noopResponse.Contains(@"* 1 EXISTS"), noopResponse);
}
示例13: TestRenameAndList5
public void TestRenameAndList5()
{
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPClientSimulator();
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();
CustomAssert.IsFalse(result.Contains(" Root1\r\n"));
CustomAssert.IsTrue(result.Contains("Root2.Root4.Root1\"\r\n"));
CustomAssert.IsFalse(oSimulator.SelectFolder("Root1"));
CustomAssert.IsTrue(oSimulator.SelectFolder("Root2.Root4.Root1"));
oSimulator.Disconnect();
}
示例14: TestRename
public void TestRename()
{
Application application = SingletonProvider<TestSetup>.Instance.GetApp();
Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
var oSimulator = new IMAPClientSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
CustomAssert.IsTrue(oSimulator.CreateFolder("Root1"));
CustomAssert.IsTrue(oSimulator.CreateFolder("Root1.Sub1"));
CustomAssert.IsTrue(oSimulator.CreateFolder("Root1.Sub2"));
CustomAssert.IsTrue(oSimulator.CreateFolder("Root1.Sub3"));
CustomAssert.IsTrue(oSimulator.SelectFolder("Root1"));
CustomAssert.IsTrue(oSimulator.SelectFolder("Root1.Sub1"));
CustomAssert.IsTrue(oSimulator.SelectFolder("Root1.Sub2"));
CustomAssert.IsTrue(oSimulator.SelectFolder("Root1.Sub3"));
CustomAssert.IsTrue(oSimulator.RenameFolder("Root1", "Root2"));
CustomAssert.IsTrue(oSimulator.SelectFolder("Root2"));
CustomAssert.IsTrue(oSimulator.SelectFolder("Root2.Sub1"));
CustomAssert.IsTrue(oSimulator.SelectFolder("Root2.Sub2"));
CustomAssert.IsTrue(oSimulator.SelectFolder("Root2.Sub3"));
oSimulator.Disconnect();
}