本文整理汇总了C#中Stack.MoveNext方法的典型用法代码示例。如果您正苦于以下问题:C# Stack.MoveNext方法的具体用法?C# Stack.MoveNext怎么用?C# Stack.MoveNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stack
的用法示例。
在下文中一共展示了Stack.MoveNext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VerifyEnumerator
private bool VerifyEnumerator(string testId, Stack<int>.Enumerator enumerator, int[] expectedValues)
{
string errorInfo;
int i = 0;
while (enumerator.MoveNext())
{
if (enumerator.Current != expectedValues[i])
{
errorInfo = "The element at the current positon [" + i + "] is not the value " +
expectedValues[i] + " as expected, actually is " + enumerator.Current + ".";
TestLibrary.TestFramework.LogError(testId + ".1", errorInfo);
return false;
}
++i;
};
if (i != expectedValues.Length)
{
errorInfo = "The item count of the stack is not the value " +
expectedValues.Length + " as expected, actually is " + i + ".";
TestLibrary.TestFramework.LogError(testId + ".2", errorInfo);
return false;
}
return true;
}
示例2: VerifyEnumerator
private bool VerifyEnumerator(Stack<int>.Enumerator enumerator, int[] expectedValues)
{
bool retVal = true;
int i = 0;
while(enumerator.MoveNext())
{
if (enumerator.Current != expectedValues[i]) return false;
++i;
};
retVal = i == expectedValues.Length;
return retVal;
}