【发布时间】:2015-08-24 20:42:31
【问题描述】:
我有这个方法:
public static IEnumerable<T> Jumping<T>( this IEnumerable<T> sequence, int step)
{
if(sequence==null)
throw new ArgumentNullException();
if(step<0)
throw new ArgumentOutOfRangeException();
var s = sequence.GetEnumerator();
for (int i = 0; i <= step; i++)
{
if (!s.MoveNext())
{
s.Reset();
s.MoveNext();
}
if (i == step)
{
i = 0;
yield return s.Current;
}
}
}
请求是创建一个无限序列的NUnit测试,我该怎么做?
【问题讨论】:
-
不确定你对无限序列的测试期望什么(序列的创建显然是 stackoverflow.com/questions/9399717/… 之类的东西)。我假设你知道en.wikipedia.org/wiki/Halting_problem ...
标签: c# unit-testing testing nunit