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


C# IMAPClientSimulator.Send方法代码示例

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


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

示例1: TestBatchOfCommands

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

             var oSimulator = new IMAPClientSimulator();
             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon(account.Address, "test");

             string commandSequence = "";
             for (int i = 0; i < 200; i++)
             {
            commandSequence += "A" + i.ToString() + " SELECT INBOX\r\n";
             }
             commandSequence = commandSequence.TrimEnd("\r\n".ToCharArray());

             string result = oSimulator.Send(commandSequence);
             CustomAssert.IsFalse(result.StartsWith("* BYE"));

             oSimulator.Disconnect();

             sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon(account.Address, "test");
             commandSequence = "";
             for (int i = 0; i < 500; i++)
             {
            commandSequence += "A" + i.ToString() + " SELECT INBOX\r\n";
             }
             commandSequence = commandSequence.TrimEnd("\r\n".ToCharArray());

             result = oSimulator.Send(commandSequence);
             CustomAssert.IsFalse(result.StartsWith("* BYE Excessive number of buffered commands"));
             oSimulator.Disconnect();
        }
开发者ID:digitalsoft,项目名称:hmailserver,代码行数:33,代码来源:CommandSequences.cs

示例2: TestIMAPServerLiteral

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

示例3: TestCreateDeepFolder

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

             var oSimulator = new IMAPClientSimulator();

             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");
             CustomAssert.IsTrue(result.Contains("A01 NO"));

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

示例4: TestLongCommand

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

             var oSimulator = new IMAPClientSimulator();
             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.Logon(account.Address, "test");

             var sb = new StringBuilder();

             for (int i = 0; i < 240000; i++)
             {
            sb.Append("A");
             }

             string result = oSimulator.Send("A01 " + sb);
             CustomAssert.IsTrue(result.Length == 0 || result.StartsWith("A01"));
        }
开发者ID:digitalsoft,项目名称:hmailserver,代码行数:18,代码来源:CommandSequences.cs

示例5: TestCreateLongFolder

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

             var oSimulator = new IMAPClientSimulator();

             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);
             CustomAssert.IsTrue(result.Contains("A01 OK"));
             CustomAssert.IsTrue(oSimulator.SelectFolder(folderName));

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

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

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

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

示例7: TestRenameIncorrectParameters

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

             var oSimulator = new IMAPClientSimulator();

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

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

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

示例8: TestCreateUnnamedSubFolder

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

             var simulator = new IMAPClientSimulator();

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

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

示例9: TestSearchORWithLiterals3

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

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

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

             var oSimulator = new IMAPClientSimulator();

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

             CustomAssert.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)");
             CustomAssert.IsTrue(result.StartsWith("* SEARCH 2"));
        }
开发者ID:digitalsoft,项目名称:hmailserver,代码行数:25,代码来源:Search.cs

示例10: TestHierarchyDelimiterNamespaceResponse

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

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

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

             settings.IMAPHierarchyDelimiter = ".";

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

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

             settings.IMAPHierarchyDelimiter = "/";

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

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

示例11: TestFolderNamesWithUnicodeChars

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

             var oSimulator = new IMAPClientSimulator();

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

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

示例12: TestOutOfBounds

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

             var oSimulator = new IMAPClientSimulator();

             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:digitalsoft,项目名称:hmailserver,代码行数:13,代码来源:Basics.cs

示例13: TestNamespace

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

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

             var oSimulator = new IMAPClientSimulator();

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

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

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

示例14: TestLiterals

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

             var oSimulator = new IMAPClientSimulator();

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

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

示例15: TestList

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

             var oSimulator = new IMAPClientSimulator();

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


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