本文整理汇总了C#中Loop.CreateStep方法的典型用法代码示例。如果您正苦于以下问题:C# Loop.CreateStep方法的具体用法?C# Loop.CreateStep怎么用?C# Loop.CreateStep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loop
的用法示例。
在下文中一共展示了Loop.CreateStep方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: A_new_step_should_be_added_directly_if_it_contains_no_child_loops
public void A_new_step_should_be_added_directly_if_it_contains_no_child_loops()
{
using (var loop = new Loop(Times.Once()))
{
var step = loop.CreateStep("", Times.Once());
Assert.That(loop.Steps.Contains(step));
}
}
示例2: A_new_step_should_be_added_to_most_recently_created_child_loop
public void A_new_step_should_be_added_to_most_recently_created_child_loop()
{
using (var loop = new Loop(Times.Once()))
{
using (loop.CreateLoop(Times.Once()))
{
using (loop.CreateLoop(Times.Once()))
{
}
using (var child2 = loop.CreateLoop(Times.Once()))
{
var step2 = loop.CreateStep("", Times.Once());
Assert.That(child2.Steps.Contains(step2));
using (var child3 = loop.CreateLoop(Times.Once()))
{
var step3 = loop.CreateStep("", Times.Once());
Assert.That(child3.Steps.Contains(step3));
}
}
}
}
}
示例3: 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);
}
}
示例4: 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));
}
}
示例5: 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));
}
}
示例6: 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));
}
}