本文整理汇总了C#中IMAPSimulator.ExamineFolder方法的典型用法代码示例。如果您正苦于以下问题:C# IMAPSimulator.ExamineFolder方法的具体用法?C# IMAPSimulator.ExamineFolder怎么用?C# IMAPSimulator.ExamineFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMAPSimulator
的用法示例。
在下文中一共展示了IMAPSimulator.ExamineFolder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExamineFolderRequiresReadPermission
public void ExamineFolderRequiresReadPermission()
{
hMailServer.Application application = SingletonProvider<Utilities>.Instance.GetApp();
hMailServer.Account account1 = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
hMailServer.IMAPFolders publicFolders = _settings.PublicFolders;
hMailServer.IMAPFolder folder = publicFolders.Add("Share1");
folder.Save();
hMailServer.IMAPFolderPermission permission = folder.Permissions.Add();
permission.PermissionAccountID = account1.ID;
permission.PermissionType = hMailServer.eACLPermissionType.ePermissionTypeUser;
permission.set_Permission(hMailServer.eACLPermission.ePermissionLookup, true);
permission.Save();
string selectResult = string.Empty;
IMAPSimulator oSimulator1 = new IMAPSimulator();
oSimulator1.Connect();
oSimulator1.LogonWithLiteral(account1.Address, "test");
string examineResult = oSimulator1.ExamineFolder("#Public.Share1");
oSimulator1.Disconnect();
Assert.IsTrue(examineResult.Contains("ACL: Read permission denied (Required for EXAMINE command)."), examineResult);
}
示例2: TestExamineResponse
public void TestExamineResponse()
{
hMailServer.Account account = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
SMTPClientSimulator.StaticSend(account.Address, account.Address, "Test", "Test");
POP3Simulator.AssertMessageCount(account.Address, "test", 1);
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
oSimulator.Logon("[email protected]", "test");
string result = oSimulator.ExamineFolder("Inbox");
oSimulator.Disconnect();
Assert.IsTrue(result.Contains("* FLAGS"), result);
Assert.IsTrue(result.Contains("* 1 EXISTS"), result);
Assert.IsTrue(result.Contains("* 1 RECENT"), result);
Assert.IsTrue(result.Contains("* OK [UNSEEN 1]"), result);
Assert.IsTrue(result.Contains("* OK [PERMANENTFLAGS"), result);
Assert.IsTrue(result.Contains("* OK [UIDNEXT 2]"), result);
Assert.IsTrue(result.Contains("* OK [UIDVALIDITY"), result);
Assert.IsTrue(result.Contains("OK [READ-ONLY]"), result);
}
示例3: TestExamineNonexistantFolder
public void TestExamineNonexistantFolder()
{
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.ExamineFolder("NonexistantFolder");
Assert.IsTrue(result.Contains("BAD Folder could not be found."));
}
示例4: TestBeforeLogon
public void TestBeforeLogon()
{
hMailServer.Account oAccount = SingletonProvider<Utilities>.Instance.AddAccount(_domain, "[email protected]", "test");
IMAPSimulator oSimulator = new IMAPSimulator();
string sWelcomeMessage = oSimulator.Connect();
Assert.IsTrue(oSimulator.ExamineFolder("NonexistantFolder").Contains("NO Authenticate first"));
Assert.IsFalse(oSimulator.SelectFolder("NonexistantFolder"));
Assert.IsFalse(oSimulator.Copy(1, "SomeFolder"));
Assert.IsFalse(oSimulator.CheckFolder("SomeFolder"));
Assert.IsTrue(oSimulator.Fetch("123 a").Contains("NO Authenticate first"));
Assert.IsTrue(oSimulator.List().Contains("NO Authenticate first"));
Assert.IsTrue(oSimulator.LSUB().Contains("NO Authenticate first"));
Assert.IsTrue(oSimulator.GetMyRights("APA").Contains("NO Authenticate first"));
Assert.IsFalse(oSimulator.RenameFolder("A", "B"));
Assert.IsFalse(oSimulator.Status("SomeFolder", "MESSAGES").Contains("A01 OK"));
}