当前位置: 首页>>代码示例>>C#>>正文


C# IMAPSimulator.CreateFolder方法代码示例

本文整理汇总了C#中RegressionTests.Shared.IMAPSimulator.CreateFolder方法的典型用法代码示例。如果您正苦于以下问题:C# IMAPSimulator.CreateFolder方法的具体用法?C# IMAPSimulator.CreateFolder怎么用?C# IMAPSimulator.CreateFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RegressionTests.Shared.IMAPSimulator的用法示例。


在下文中一共展示了IMAPSimulator.CreateFolder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestCreateFolderWithHash

        public void TestCreateFolderWithHash()
        {
            Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             var oSimulator = new IMAPSimulator();

             oSimulator.Connect();
             oSimulator.Logon(oAccount.Address, "test");
             CustomAssert.IsFalse(oSimulator.CreateFolder("#Test"));
             CustomAssert.IsTrue(oSimulator.CreateFolder("Test.#Testar"));
             oSimulator.Disconnect();
        }
开发者ID:japi,项目名称:hmailserver,代码行数:12,代码来源:Folders.cs

示例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 IMAPSimulator(true, 14300);
               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;
            }
             }
        }
开发者ID:japi,项目名称:hmailserver,代码行数:27,代码来源:Basics.cs

示例3: TestCreateFolderWithSlash

        public void TestCreateFolderWithSlash()
        {
            Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             const string folderName = "ABC\\123";

             var oSimulator = new IMAPSimulator();
             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();
        }
开发者ID:japi,项目名称:hmailserver,代码行数:14,代码来源:Folders.cs

示例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 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();
        }
开发者ID:jrallo,项目名称:hMailServer,代码行数:19,代码来源:HierarchyDelimiter.cs

示例5: TestAppendFolderNameInOctet

        public void TestAppendFolderNameInOctet()
        {
            Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             var 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);
        }
开发者ID:jrallo,项目名称:hMailServer,代码行数:23,代码来源:Basics.cs

示例6: TestListWithReference

        public void TestListWithReference()
        {
            Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             var oSimulator = new IMAPSimulator();
             oSimulator.ConnectAndLogon(oAccount.Address, "test");
             oSimulator.CreateFolder("Main.Sub1.Sub2.Sub3");
             oSimulator.CreateFolder("SomeOtherFolder");

             oSimulator.Subscribe("Main");
             oSimulator.Subscribe("Main.Sub1");
             oSimulator.Subscribe("Main.Sub1.Sub2");
             oSimulator.Subscribe("Main.Sub1.Sub2.Sub3");
             oSimulator.Subscribe("SomeOtherFolder");

             string response = oSimulator.List("Main", "*", true);
             CustomAssert.IsFalse(response.Contains("INBOX"));
             CustomAssert.IsFalse(response.Contains("SomeOtherFolder"));
             CustomAssert.IsTrue(response.Contains("* LIST (\\HasChildren) \".\" \"Main.Sub1\""));
             CustomAssert.IsTrue(response.Contains("* LIST (\\HasChildren) \".\" \"Main.Sub1.Sub2\""));
             CustomAssert.IsTrue(response.Contains("* LIST (\\HasNoChildren) \".\" \"Main.Sub1.Sub2.Sub3\""));

             response = oSimulator.List("Main.Sub1", "*", true);
             CustomAssert.IsFalse(response.Contains("INBOX"));
             CustomAssert.IsFalse(response.Contains("SomeOtherFolder"));
             CustomAssert.IsTrue(response.Contains("* LIST (\\HasChildren) \".\" \"Main.Sub1.Sub2\""));
             CustomAssert.IsTrue(response.Contains("* LIST (\\HasNoChildren) \".\" \"Main.Sub1.Sub2.Sub3\""));

             response = oSimulator.LSUB("Main", "*");
             CustomAssert.IsFalse(response.Contains("INBOX"));
             CustomAssert.IsFalse(response.Contains("SomeOtherFolder"));
             CustomAssert.IsTrue(response.Contains("* LSUB (\\HasChildren) \".\" \"Main.Sub1\""));
             CustomAssert.IsTrue(response.Contains("* LSUB (\\HasChildren) \".\" \"Main.Sub1.Sub2\""));
             CustomAssert.IsTrue(response.Contains("* LSUB (\\HasNoChildren) \".\" \"Main.Sub1.Sub2.Sub3\""));

             response = oSimulator.LSUB("Main.Sub1", "*");
             CustomAssert.IsFalse(response.Contains("INBOX"));
             CustomAssert.IsFalse(response.Contains("SomeOtherFolder"));
             CustomAssert.IsTrue(response.Contains("* LSUB (\\HasChildren) \".\" \"Main.Sub1.Sub2\""));
             CustomAssert.IsTrue(response.Contains("* LSUB (\\HasNoChildren) \".\" \"Main.Sub1.Sub2.Sub3\""));

             oSimulator.Disconnect();
        }
开发者ID:japi,项目名称:hmailserver,代码行数:43,代码来源:Folders.cs

示例7: TestListCommandChangedHierarchyDelimiter

        public void TestListCommandChangedHierarchyDelimiter()
        {
            Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");
             _settings.IMAPHierarchyDelimiter = "\\";

             var oSimulator = new IMAPSimulator();

             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);
        }
开发者ID:japi,项目名称:hmailserver,代码行数:20,代码来源:Folders.cs

示例8: TestRecentRemovedOnMailboxClose

        public void TestRecentRemovedOnMailboxClose()
        {
            Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "TestMessage");
             IMAPSimulator.AssertMessageCount(account.Address, "test", "Inbox", 1);

             var 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());
        }
开发者ID:jrallo,项目名称:hMailServer,代码行数:22,代码来源:Basics.cs

示例9: TestFolderQuote

        public void TestFolderQuote()
        {
            Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             const string folderName = "Test*";

             var oSimulator = new IMAPSimulator();
             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon(oAccount.Address, "test");
             Assert.IsTrue(oSimulator.CreateFolder(folderName));
             Assert.IsTrue(oSimulator.Subscribe(folderName));
             Assert.IsTrue(oSimulator.LSUB().Contains("\"" + folderName + "\""));
             oSimulator.Disconnect();
        }
开发者ID:jrallo,项目名称:hMailServer,代码行数:14,代码来源:Folders.cs

示例10: TestRenameToSubFolder

        public void TestRenameToSubFolder()
        {
            Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             var oSimulator = new IMAPSimulator();

             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();
        }
开发者ID:japi,项目名称:hmailserver,代码行数:21,代码来源:Folders.cs

示例11: TestRenameSubFolderToMatchingName

        public void TestRenameSubFolderToMatchingName()
        {
            Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             var oSimulator = new IMAPSimulator();
             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();
        }
开发者ID:japi,项目名称:hmailserver,代码行数:20,代码来源:Folders.cs

示例12: TestRenameSubFolderToChildSub

        public void TestRenameSubFolderToChildSub()
        {
            Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             var oSimulator = new IMAPSimulator();
             Assert.IsTrue(oSimulator.ConnectAndLogon(account.Address, "test"));
             Assert.IsTrue(oSimulator.CreateFolder("A.B"));

             string result;
             Assert.IsFalse(oSimulator.RenameFolder("A.B", "A.B.C", out result));
             Assert.IsTrue(result.Contains("A folder cannot be moved into one of its subfolders."));

             Assert.IsTrue(oSimulator.SelectFolder("A.B"));

             oSimulator.Disconnect();
        }
开发者ID:jrallo,项目名称:hMailServer,代码行数:16,代码来源:Folders.cs

示例13: TestDelete

        public void TestDelete()
        {
            Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             var oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");
             Assert.IsFalse(oSimulator.DeleteFolder("DoesNotExist"));
             Assert.IsTrue(oSimulator.CreateFolder("DoesExist"));
             Assert.IsTrue(oSimulator.SelectFolder("DoesExist"));
             oSimulator.Close();
             Assert.IsTrue(oSimulator.DeleteFolder("DoesExist"));
             Assert.IsFalse(oSimulator.SelectFolder("DoesExist"));
        }
开发者ID:jrallo,项目名称:hMailServer,代码行数:15,代码来源:Basics.cs

示例14: TestCheck

        public void TestCheck()
        {
            SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             var oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");
             Assert.IsTrue(oSimulator.CreateFolder("TestFolder"));
             Assert.IsTrue(oSimulator.CheckFolder("TestFolder"));
             oSimulator.Disconnect();
        }
开发者ID:jrallo,项目名称:hMailServer,代码行数:12,代码来源:Basics.cs

示例15: TestUnsubscribe

        public void TestUnsubscribe()
        {
            Account oAccount = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "[email protected]", "test");

             var oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");
             Assert.IsTrue(oSimulator.CreateFolder("TestFolder1"));
             Assert.IsTrue(oSimulator.CreateFolder("TestFolder2"));

             if (!oSimulator.Subscribe("TestFolder1"))
            Assert.Fail("Subscribe on existent folder failed");
             if (!oSimulator.Subscribe("TestFolder2"))
            Assert.Fail("Subscribe on existent folder failed");

             if (!oSimulator.Unsubscribe("TestFolder1"))
            Assert.Fail("Unsubscribe on existent folder failed");
             if (!oSimulator.Unsubscribe("TestFolder2"))
            Assert.Fail("Unsubscribe on existent folder failed");
        }
开发者ID:jrallo,项目名称:hMailServer,代码行数:21,代码来源:Basics.cs


注:本文中的RegressionTests.Shared.IMAPSimulator.CreateFolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。