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


C# IMAPSimulator.Send方法代码示例

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


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

示例1: TestIMAPServerLiteral

 public void TestIMAPServerLiteral()
 {
     IMAPSimulator sim = new IMAPSimulator();
     sim.Connect();
     Assert.IsTrue(sim.Send("a01 login " + GetUsername() + " {4}").StartsWith("+"));
     sim.Send(GetPassword());
     EnsureNoPassword();
 }
开发者ID:nberardi,项目名称:hMailServer,代码行数:8,代码来源:Security.PasswordMasking.cs

示例2: TestCreateDeepFolder

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

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.LogonWithLiteral(oAccount.Address, "test");
             string result = oSimulator.Send("A01 CREATE 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.26");
             Assert.IsTrue(result.Contains("A01 NO"));

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

示例3: TestHierarchyDelimiterNamespaceResponse

        public void TestHierarchyDelimiterNamespaceResponse()
        {
            hMailServer.Application application = SingletonProvider<Utilities>.Instance.GetApp();
            hMailServer.Settings settings = _settings;
            settings.IMAPHierarchyDelimiter = "\\";
            string publicFolderName = _settings.IMAPPublicFolderName;

            hMailServer.Account account = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");

            IMAPSimulator oSimulator = new IMAPSimulator();
            oSimulator.ConnectAndLogon(account.Address, "test");
            string result = oSimulator.Send("A01 NAMESPACE");
            string correctNamespaceSetting = "* NAMESPACE ((\"\" \"\\\\\")) NIL ((\"" + publicFolderName + "\" \"\\\\\"))";
            Assert.IsTrue(result.Contains(correctNamespaceSetting), result);
            oSimulator.Disconnect();

            settings.IMAPHierarchyDelimiter = ".";

            oSimulator = new IMAPSimulator();
            oSimulator.ConnectAndLogon(account.Address, "test");

            result = oSimulator.Send("A01 NAMESPACE");
            correctNamespaceSetting = "* NAMESPACE ((\"\" \".\")) NIL ((\"" + publicFolderName + "\" \".\"))";
            Assert.IsTrue(result.Contains(correctNamespaceSetting), result);
            oSimulator.Disconnect();

            settings.IMAPHierarchyDelimiter = "/";

            oSimulator = new IMAPSimulator();
            oSimulator.ConnectAndLogon(account.Address, "test");

            result = oSimulator.Send("A01 NAMESPACE");
            correctNamespaceSetting = "* NAMESPACE ((\"\" \"/\")) NIL ((\"" + publicFolderName + "\" \"/\"))";
            Assert.IsTrue(result.Contains(correctNamespaceSetting), result);
            oSimulator.Disconnect();
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:36,代码来源:IMAP.HierarchyDelimiter.cs

示例4: TestCreateLongFolder

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

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.LogonWithLiteral(oAccount.Address, "test");

             string folderName = "";
             for (int i = 0; i < 255; i++)
            folderName = folderName + "A";

             string result = oSimulator.Send("A01 CREATE " + folderName);
             Assert.IsTrue(result.Contains("A01 OK"));
             Assert.IsTrue(oSimulator.SelectFolder(folderName));

             folderName = "";
             for (int i = 0; i < 256; i++)
            folderName = folderName + "A";

             result = oSimulator.Send("A01 CREATE " + folderName);
             Assert.IsTrue(result.Contains("A01 NO"));
             Assert.IsFalse(oSimulator.SelectFolder(folderName));

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

示例5: TestRenameToAndFromINBOX

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

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.LogonWithLiteral(oAccount.Address, "test");
             oSimulator.Send("A01 CREATE A\r\n");
             Assert.IsFalse(oSimulator.RenameFolder("A", "INBOX"));
             Assert.IsFalse(oSimulator.RenameFolder("INBOX", "B"));

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

示例6: TestRenameIncorrectParameters

        public void TestRenameIncorrectParameters()
        {
            hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "fold[email protected]", "test");

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.LogonWithLiteral(oAccount.Address, "test");
             string result = oSimulator.Send("A01 CREATE A");

             result = oSimulator.Send("A02 RENAME A B C");
             Assert.IsTrue(result.Contains("A02 BAD"));

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

示例7: TestCreateUnnamedSubFolder

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

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.LogonWithLiteral(oAccount.Address, "test");
             string result = oSimulator.Send("A01 CREATE 1..3");
             Assert.IsTrue(result.Contains("A01 NO"));
             result = oSimulator.Send("A01 CREATE 1....3");
             Assert.IsTrue(result.Contains("A01 NO"));
             result = oSimulator.Send("A01 CREATE 1.......3");
             Assert.IsTrue(result.Contains("A01 NO"));

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

示例8: TestSearchORWithLiterals3

        public void TestSearchORWithLiterals3()
        {
            hMailServer.Application application = SingletonProvider<Utilities>.Instance.GetApp();

              ;
              hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");

              // Send a message to this account.
              SMTPClientSimulator oSMTP = new SMTPClientSimulator();
              oSMTP.Send("[email protected]", "[email protected]", "Test1", "This is a test of IMAP Search");
              IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 1);
              oSMTP.Send("[email protected]", "[email protected]", "Test2", "This is a test of IMAP Search");
              IMAPSimulator.AssertMessageCount("[email protected]", "test", "INBOX", 2);

              IMAPSimulator oSimulator = new IMAPSimulator();

              string sWelcomeMessage = oSimulator.Connect();
              oSimulator.Logon("[email protected]", "test");

              Assert.IsTrue(oSimulator.SelectFolder("INBOX"));

              string result = oSimulator.Send("A01 SEARCH ALL OR (HEADER SUBJECT {5}");
              result = oSimulator.Send("Test5) (HEADER SUBJECT {5}");
              result = oSimulator.Send("Test2)");
              Assert.IsTrue(result.StartsWith("* SEARCH 2"));
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:26,代码来源:IMAP.Search.cs

示例9: TestLiterals

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

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");
             string result = oSimulator.Send("A01 CREATE {4}");
             result = oSimulator.Send("HEJS");

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

示例10: TestList

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

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");
             string result = oSimulator.Send("A01 LIST \"\" \"*\"\r\n").Substring(0, 1);
             Assert.AreEqual("*", result);
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:11,代码来源:IMAP.cs

示例11: TestFolderNamesWithUnicodeChars

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

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.LogonWithLiteral("[email protected]", "test");
             oSimulator.Send("A01 CREATE &AMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQ-\r\n");
             oSimulator.Disconnect();

             string s = oAccount.IMAPFolders[1].Name;
             Assert.AreEqual("ÄÄÄÄÄÄÄÄÄÄÄÄÄ", s);
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:14,代码来源:IMAP.cs

示例12: TestOutOfBounds

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

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");

             string s = oSimulator.Send("A01 RENAME TEST");
             if (s.StartsWith("A01 BAD") == false)
            throw new Exception("ERROR - Out of bounds test failed");
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:13,代码来源:IMAP.cs

示例13: TestNamespace

        public void TestNamespace()
        {
            string imapFolderName = _settings.IMAPPublicFolderName;

             hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");

             IMAPSimulator oSimulator = new IMAPSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon("[email protected]", "test");
             string result = oSimulator.Send("A01 NAMESPACE");

             string correctNamespaceSetting = "* NAMESPACE ((\"\" \".\")) NIL ((\"" + imapFolderName + "\" \".\"))";

             if (!result.Contains(correctNamespaceSetting))
             {
            Assert.Fail("Namespace failed");
             }
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:19,代码来源:IMAP.cs


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