本文整理汇总了C#中RegressionTests.Shared.IMAPClientSimulator.AssertFolderExists方法的典型用法代码示例。如果您正苦于以下问题:C# IMAPClientSimulator.AssertFolderExists方法的具体用法?C# IMAPClientSimulator.AssertFolderExists怎么用?C# IMAPClientSimulator.AssertFolderExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RegressionTests.Shared.IMAPClientSimulator
的用法示例。
在下文中一共展示了IMAPClientSimulator.AssertFolderExists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssertMessageCount
public static void AssertMessageCount(string accountName, string accountPassword, string folderName,
int expectedCount)
{
if (expectedCount == 0)
{
// make sure that we aren't currently delivering messages.
TestSetup.AssertRecipientsInDeliveryQueue(0);
}
var oIMAP = new IMAPClientSimulator();
CustomAssert.IsTrue(oIMAP.ConnectAndLogon(accountName, accountPassword));
if (expectedCount != 0)
oIMAP.AssertFolderExists(folderName);
int currentCount = 0;
int timeout = 1000; // 1000 * 25 = 25 seconds.
while (timeout > 0)
{
currentCount = oIMAP.GetMessageCount(folderName);
if (currentCount > expectedCount)
break;
if (currentCount == expectedCount)
{
oIMAP.Disconnect();
return;
}
timeout--;
Thread.Sleep(25);
}
oIMAP.Disconnect();
string error = "Wrong number of messages in mailbox " + folderName + " in account " + accountName +
" Actual: " + currentCount.ToString() + " Expected: " + expectedCount.ToString();
CustomAssert.Fail(error);
}