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


C# ImapClientSimulator.LogonWithLiteral方法代码示例

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


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

示例1: TestDateSortOrder

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

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.LogonWithLiteral("[email protected]", "test");
             Assert.IsTrue(oSimulator.SelectFolder("Inbox"));

             string response =
            oSimulator.SendSingleCommandWithLiteral("A04 APPEND INBOX \"22-Feb-2008 22:00:00 +0200\" {37}",
                                                    "Date: Wed, 15 Dec 2010 13:00:00 +0000");
             Assert.IsTrue(response.Contains("* 1 EXISTS"), response);

             response = oSimulator.SendSingleCommandWithLiteral("A04 APPEND INBOX \"22-Feb-2008 21:00:00 +0200\" {37}",
                                                            "Date: Wed, 15 Dec 2010 14:00:00 +0000");
             Assert.IsTrue(response.Contains("* 2 EXISTS"), response);

             response = oSimulator.SendSingleCommandWithLiteral("A04 APPEND INBOX \"22-Feb-2008 20:00:00 +0200\" {37}",
                                                            "Date: Wed, 15 Dec 2010 12:00:00 +0000");
             Assert.IsTrue(response.Contains("* 3 EXISTS"), response);

             response = oSimulator.SendSingleCommandWithLiteral("A04 APPEND INBOX \"23-Feb-2008 01:30:23 +0200\" {37}",
                                                            "Date: Wed, 15 Dec 2010 11:00:00 +0000");
             Assert.IsTrue(response.Contains("* 4 EXISTS"), response);

             string sortDateResponse = oSimulator.SendSingleCommand("A10 SORT (DATE) US-ASCII ALL");

             Assert.IsTrue(sortDateResponse.Contains(" 4 3 1 2"));
             oSimulator.Disconnect();
        }
开发者ID:SpivEgin,项目名称:hmailserver,代码行数:31,代码来源:Sort.cs

示例2: FolderMarkedAsReadOnlyWhenUserHasReadOnlyRights

        public void FolderMarkedAsReadOnlyWhenUserHasReadOnlyRights()
        {
            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.ePermissionLookup, true);
             permission.set_Permission(eACLPermission.ePermissionRead, true);
             permission.Save();

             string selectResult = string.Empty;

             var imapClientSimulator = new ImapClientSimulator();
             imapClientSimulator.Connect();
             imapClientSimulator.LogonWithLiteral(account1.Address, "test");
             imapClientSimulator.SelectFolder("#Public.Share1", out selectResult);
             imapClientSimulator.Disconnect();

             Assert.IsTrue(selectResult.Contains("[READ-ONLY]"), selectResult);
             Assert.IsFalse(selectResult.Contains("[READ-WRITE]"), selectResult);
        }
开发者ID:SpivEgin,项目名称:hmailserver,代码行数:28,代码来源:ACL.cs

示例3: ConfirmFileAddedToCorrectAccountFolder

        public void ConfirmFileAddedToCorrectAccountFolder()
        {
            TestSetup testSetup = SingletonProvider<TestSetup>.Instance;
             Account oAccount = testSetup.AddAccount(_domain, "[email protected]", "test");
             var oSimulator = new ImapClientSimulator();

             // Confirm that the public folder is empty before we start our test.
             string publicDir = GetPublicDirectory();
             CustomAsserts.AssertFilesInDirectory(publicDir, 0);

             // Add a message to the inbox.
             oSimulator.Connect();
             oSimulator.LogonWithLiteral("[email protected]", "test");
             oSimulator.SendSingleCommandWithLiteral("A01 APPEND INBOX {4}", "ABCD");

             // Confirm it exists in the IMAP folder.
             Assert.AreEqual(1, oSimulator.GetMessageCount("INBOX"));
             oSimulator.Disconnect();

             // The public directory should still be empty - the message was added to the user account.
             CustomAsserts.AssertFilesInDirectory(publicDir, 0);

             // There should be a single file in the users directory.
             CustomAsserts.AssertFilesInUserDirectory(oAccount, 1);
        }
开发者ID:SpivEgin,项目名称:hmailserver,代码行数:25,代码来源:Append.cs

示例4: ExamineFolderRequiresReadPermission

        public void ExamineFolderRequiresReadPermission()
        {
            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.ePermissionLookup, true);
             permission.Save();

             string selectResult = string.Empty;

             var imapClientSimulator = new ImapClientSimulator();
             imapClientSimulator.Connect();
             imapClientSimulator.LogonWithLiteral(account1.Address, "test");
             string examineResult = imapClientSimulator.ExamineFolder("#Public.Share1");
             imapClientSimulator.Disconnect();

             Assert.IsTrue(examineResult.Contains("ACL: Read permission denied (Required for EXAMINE command)."),
                       examineResult);
        }
开发者ID:SpivEgin,项目名称:hmailserver,代码行数:27,代码来源:ACL.cs

示例5: TestAppendBadLiteral

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

             var oSimulator = new ImapClientSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.LogonWithLiteral("[email protected]", "test");
             oSimulator.SendSingleCommandWithLiteral("A01 APPEND INBOX {TEST}", "ABCD");
             Assert.AreEqual(0, oSimulator.GetMessageCount("INBOX"));
             oSimulator.Disconnect();
        }
开发者ID:baa-archieve,项目名称:hmailserver,代码行数:12,代码来源:Basics.cs

示例6: 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");
             Assert.IsTrue(result.Contains("A01 NO"));

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

示例7: ConfirmFileAddedToCorrectPublicFolder

        public void ConfirmFileAddedToCorrectPublicFolder()
        {
            TestSetup testSetup = SingletonProvider<TestSetup>.Instance;
             Account oAccount = testSetup.AddAccount(_domain, "[email protected]", "test");
             var oSimulator = new ImapClientSimulator();

             // Confirm that the public folder is empty before we start our test.
             string publicDir = GetPublicDirectory();
             CustomAsserts.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("[email protected]", "test");
             oSimulator.SendSingleCommandWithLiteral("A01 APPEND #Public.Share {4}", "ABCD");

             // Confirm that the message exists in the public folder and not in the inbox.
             Assert.AreEqual(1, oSimulator.GetMessageCount("#Public.Share"));
             Assert.AreEqual(0, oSimulator.GetMessageCount("INBOX"));
             oSimulator.Disconnect();

             // The public directory should now contain the message.
             CustomAsserts.AssertFilesInDirectory(publicDir, 1);

             // There users directory should still be empty.
             CustomAsserts.AssertFilesInUserDirectory(oAccount, 0);
        }
开发者ID:SpivEgin,项目名称:hmailserver,代码行数:38,代码来源:Append.cs

示例8: TestDateSortOrderNonexistantDate

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

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.LogonWithLiteral("[email protected]", "test");
             Assert.IsTrue(oSimulator.SelectFolder("Inbox"));

             string response = oSimulator.SendSingleCommandWithLiteral(
            "A04 APPEND INBOX \"22-Feb-2008 22:00:00 +0200\" {4}", "ABCD");
             Assert.IsTrue(response.Contains("* 1 EXISTS"), response);

             response = oSimulator.SendSingleCommandWithLiteral("A04 APPEND INBOX \"22-Feb-2008 21:00:00 +0200\" {4}",
                                                            "ABCD");
             Assert.IsTrue(response.Contains("* 2 EXISTS"), response);

             response = oSimulator.SendSingleCommandWithLiteral("A04 APPEND INBOX \"22-Feb-2008 20:00:00 +0200\" {4}",
                                                            "ABCD");
             Assert.IsTrue(response.Contains("* 3 EXISTS"), response);

             response = oSimulator.SendSingleCommandWithLiteral("A04 APPEND INBOX \"23-Feb-2008 01:30:23 +0200\" {4}",
                                                            "ABCD");
             Assert.IsTrue(response.Contains("* 4 EXISTS"), response);

             /*
              * RFC 5256 "2.2. Sent Date" chapter. If the sent date cannot be determined (a Date: header is missing or cannot be parsed),
              * the INTERNALDATE for that message is used as the sent date.
              */

             string sortDateResponse = oSimulator.SendSingleCommand("A10 SORT (DATE) US-ASCII ALL");
             string sortArivalDateResponse = oSimulator.SendSingleCommand("A10 SORT (ARRIVAL) US-ASCII ALL");

             Assert.IsTrue(sortArivalDateResponse.Contains(" 3 2 1 4"));
             Assert.AreEqual(sortDateResponse, sortArivalDateResponse);
             oSimulator.Disconnect();
        }
开发者ID:SpivEgin,项目名称:hmailserver,代码行数:37,代码来源:Sort.cs

示例9: TestSetAclOnPublicFolderNormalUser

        public void TestSetAclOnPublicFolderNormalUser()
        {
            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();

             var imapClientSimulator = new ImapClientSimulator();
             imapClientSimulator.Connect();
             imapClientSimulator.LogonWithLiteral(account1.Address, "test");
             Assert.IsFalse(imapClientSimulator.CreateFolder("#Public.Share1.MySub1"));
             imapClientSimulator.Disconnect();
        }
开发者ID:SpivEgin,项目名称:hmailserver,代码行数:16,代码来源:ACL.cs

示例10: TestSetAclOnPublicFolderNormalUserWithPrivilegies

        public void TestSetAclOnPublicFolderNormalUserWithPrivilegies()
        {
            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.Save();

             var imapClientSimulator = new ImapClientSimulator();
             imapClientSimulator.Connect();
             imapClientSimulator.LogonWithLiteral(account1.Address, "test");
             Assert.IsTrue(imapClientSimulator.CreateFolder("#Public.Share1.MySub1"));
             imapClientSimulator.Disconnect();
        }
开发者ID:SpivEgin,项目名称:hmailserver,代码行数:22,代码来源:ACL.cs

示例11: TestAppendToPublicFolder

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

             Account account = 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 = account.ID;
             permission.PermissionType = eACLPermissionType.ePermissionTypeUser;
             permission.set_Permission(eACLPermission.ePermissionLookup, true);
             permission.set_Permission(eACLPermission.ePermissionRead, true);
             permission.set_Permission(eACLPermission.ePermissionInsert, true);
             permission.set_Permission(eACLPermission.ePermissionPost, true);
             permission.Save();

             var oSimulator = new ImapClientSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.LogonWithLiteral(account.Address, "test");
             oSimulator.SendSingleCommandWithLiteral("A01 APPEND #Public.Share1 {4}", "ABCD");
             Assert.AreEqual(1, oSimulator.GetMessageCount("#Public.Share1"));
             oSimulator.Disconnect();
        }
开发者ID:SpivEgin,项目名称:hmailserver,代码行数:27,代码来源:ACL.cs

示例12: TestSetACLOnAccountFolder

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

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

             var imapClientSimulator = new ImapClientSimulator();
             imapClientSimulator.Connect();
             imapClientSimulator.LogonWithLiteral(account1.Address, "test");
             Assert.IsTrue(imapClientSimulator.CreateFolder("SharedFolder"));
             Assert.IsFalse(imapClientSimulator.SetACL("SharedFolder", account2.Address, "lrswipkxtea"));
             imapClientSimulator.Disconnect();
        }
开发者ID:SpivEgin,项目名称:hmailserver,代码行数:14,代码来源:ACL.cs

示例13: TestListCommandChangedHierarchyDelimiter

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

             var oSimulator = new ImapClientSimulator();

             oSimulator.Connect();
             oSimulator.LogonWithLiteral(account.Address, "test");
             oSimulator.CreateFolder("Test\\HelloWorld\\Test2");

             string response = oSimulator.List("%");
             Assert.IsTrue(response.Contains("\"Test\""), response);

             response = oSimulator.List("%\\%");
             Assert.IsTrue(response.Contains("\"Test\\HelloWorld\""), response);

             response = oSimulator.List("%\\%\\%%");
             Assert.IsTrue(response.Contains("\"Test\\HelloWorld\\Test2\""), response);
        }
开发者ID:SpivEgin,项目名称:hmailserver,代码行数:20,代码来源:Folders.cs

示例14: 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;
             Assert.AreEqual("ÄÄÄÄÄÄÄÄÄÄÄÄÄ", s);
        }
开发者ID:baa-archieve,项目名称:hmailserver,代码行数:14,代码来源:Basics.cs

示例15: TestLSUB

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

             var oSimulator = new ImapClientSimulator();

             string sWelcomeMessage = oSimulator.Connect();
             oSimulator.LogonWithLiteral("[email protected]", "test");
             string result = oSimulator.List().Substring(0, 1);
             Assert.AreEqual("*", result);
        }
开发者ID:baa-archieve,项目名称:hmailserver,代码行数:11,代码来源:Basics.cs


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