本文整理汇总了C#中Loop.RecordCall方法的典型用法代码示例。如果您正苦于以下问题:C# Loop.RecordCall方法的具体用法?C# Loop.RecordCall怎么用?C# Loop.RecordCall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loop
的用法示例。
在下文中一共展示了Loop.RecordCall方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Record_call_should_ensure_all_previous_steps_completed
public void Record_call_should_ensure_all_previous_steps_completed()
{
using (var loop = new Loop(Times.Once()))
{
var stepBefore = loop.CreateStep("", Times.AtMostOnce());
Loop nested;
Step stepNested;
using (nested = loop.CreateLoop(Times.Once()))
{
stepNested = loop.CreateStep("", Times.Once());
}
var stepAfter = loop.CreateStep("", Times.Once());
loop.RecordCall(stepNested);
Assert.That(stepBefore.Complete, Is.True);
Assert.That(loop.Complete, Is.False);
Assert.That(stepNested.Complete, Is.False);
Assert.That(stepAfter.Complete, Is.False);
loop.RecordCall(stepAfter);
Assert.That(stepBefore.Complete, Is.True);
Assert.That(nested.Complete, Is.True);
Assert.That(stepNested.Complete, Is.True);
Assert.That(stepAfter.Complete, Is.False);
}
}
示例2: RecordCall_should_throw_when_child_loop_count_exceeded
public void RecordCall_should_throw_when_child_loop_count_exceeded()
{
using (var loop = new Loop(Times.Once()))
{
Step step1;
Step step2;
using (loop.CreateLoop(Times.Exactly(2)))
{
step1 = loop.CreateStep("", Times.Once());
step2 = loop.CreateStep("", Times.Once());
}
loop.RecordCall(step1); loop.RecordCall(step2);
loop.RecordCall(step1); loop.RecordCall(step2);
Assert.Throws<SequenceException>(() => loop.RecordCall(step1));
}
}
示例3: RecordCall_should_throw_when_step_count_exceeded
public void RecordCall_should_throw_when_step_count_exceeded()
{
using (var loop = new Loop(Times.Once()))
{
var step = loop.CreateStep("", Times.Exactly(2));
loop.RecordCall(step);
loop.RecordCall(step);
Assert.Throws<SequenceException>(() => loop.RecordCall(step));
}
}
示例4: RecordCall_should_throw_if_steps_called_out_of_sequence
public void RecordCall_should_throw_if_steps_called_out_of_sequence()
{
using (var loop = new Loop(Times.Once()))
{
loop.CreateStep("", Times.Once());
var step = loop.CreateStep("", Times.Once());
Assert.Throws<SequenceException>(() => loop.RecordCall(step));
}
}