public void ConfirmFileAddedToCorrectAccountFolder() { TestSetup testSetup = SingletonProvider <TestSetup> .Instance; Account oAccount = testSetup.AddAccount(_domain, "*****@*****.**", "test"); var oSimulator = new IMAPClientSimulator(); // Confirm that the public folder is empty before we start our test. string publicDir = testSetup.GetPublicDirectory(); testSetup.AssertFilesInDirectory(publicDir, 0); // Add a message to the inbox. oSimulator.Connect(); oSimulator.LogonWithLiteral("*****@*****.**", "test"); oSimulator.SendSingleCommandWithLiteral("A01 APPEND INBOX {4}", "ABCD"); // Confirm it exists in the IMAP folder. CustomAssert.AreEqual(1, oSimulator.GetMessageCount("INBOX")); oSimulator.Disconnect(); // The public directory should still be empty - the message was added to the user account. testSetup.AssertFilesInDirectory(publicDir, 0); // There should be a single file in the users directory. testSetup.AssertFilesInUserDirectory(oAccount, 1); }
public void ConfirmFileAddedToCorrectPublicFolder() { TestSetup testSetup = SingletonProvider <TestSetup> .Instance; Account oAccount = testSetup.AddAccount(_domain, "*****@*****.**", "test"); var oSimulator = new IMAPClientSimulator(); // Confirm that the public folder is empty before we start our test. string publicDir = testSetup.GetPublicDirectory(); testSetup.AssertFilesInDirectory(publicDir, 0); IMAPFolders folders = _application.Settings.PublicFolders; IMAPFolder folder = folders.Add("Share"); folder.Save(); // Give everyone access to the folder. 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.ePermissionInsert, true); permission.Save(); // Add the message to the public folder. oSimulator.Connect(); oSimulator.LogonWithLiteral("*****@*****.**", "test"); oSimulator.SendSingleCommandWithLiteral("A01 APPEND #Public.Share {4}", "ABCD"); // Confirm that the message exists in the public folder and not in the inbox. CustomAssert.AreEqual(1, oSimulator.GetMessageCount("#Public.Share")); CustomAssert.AreEqual(0, oSimulator.GetMessageCount("INBOX")); oSimulator.Disconnect(); // The public directory should now contain the message. testSetup.AssertFilesInDirectory(publicDir, 1); // There users directory should still be empty. testSetup.AssertFilesInUserDirectory(oAccount, 0); }