当前位置: 首页>>代码示例>>C#>>正文


C# Loop.RecordCall方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:kellyselden,项目名称:Moq-Sequences,代码行数:30,代码来源:LoopTest.cs

示例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));
            }
        }
开发者ID:kellyselden,项目名称:Moq-Sequences,代码行数:19,代码来源:LoopTest.cs

示例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));
            }
        }
开发者ID:kellyselden,项目名称:Moq-Sequences,代码行数:12,代码来源:LoopTest.cs

示例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));
            }
        }
开发者ID:kellyselden,项目名称:Moq-Sequences,代码行数:10,代码来源:LoopTest.cs


注:本文中的Loop.RecordCall方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。