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


C# TestContext.RevertFixture方法代码示例

本文整理汇总了C#中StoryTeller.Engine.TestContext.RevertFixture方法的典型用法代码示例。如果您正苦于以下问题:C# TestContext.RevertFixture方法的具体用法?C# TestContext.RevertFixture怎么用?C# TestContext.RevertFixture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StoryTeller.Engine.TestContext的用法示例。


在下文中一共展示了TestContext.RevertFixture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: load_and_revert_fixtures

        public void load_and_revert_fixtures()
        {
            var context = new TestContext();

            context.LoadFixture<ArithmeticFixture>(new StubTestPart());
            context.CurrentFixture.ShouldBeOfType<ArithmeticFixture>();

            context.LoadFixture<SomethingFixture>(new StubTestPart());
            context.CurrentFixture.ShouldBeOfType<SomethingFixture>();

            context.RevertFixture(new StubTestPart());

            context.CurrentFixture.ShouldBeOfType<ArithmeticFixture>();
        }
开发者ID:DarthFubuMVC,项目名称:storyteller,代码行数:14,代码来源:TestContextTester.cs

示例2: reverting_a_fixture_with_an_exception_in_teardown_increments_exceptions_and_captures_the_exception

        public void reverting_a_fixture_with_an_exception_in_teardown_increments_exceptions_and_captures_the_exception()
        {
            var fixture = MockRepository.GenerateMock<IFixture>();
            var exception = new NotImplementedException();
            fixture.Expect(x => x.TearDown()).Throw(exception);

            var context = new TestContext();
            var section = new Section("something");

            context.LoadFixture(fixture, section);
            context.RevertFixture(section);

            context.ResultsFor(section).ExceptionText.ShouldEqual(exception.ToString());

            context.Counts.Exceptions.ShouldEqual(1);
        }
开发者ID:DarthFubuMVC,项目名称:storyteller,代码行数:16,代码来源:TestContextTester.cs

示例3: context_should_tell_a_fixture_that_it_is_finished_at_the_end

        public void context_should_tell_a_fixture_that_it_is_finished_at_the_end()
        {
            var fixture1 = MockRepository.GenerateMock<IFixture>();
            var fixture2 = MockRepository.GenerateMock<IFixture>();

            var context = new TestContext();
            context.LoadFixture(fixture1, new StubTestPart());
            fixture1.AssertWasNotCalled(x => x.TearDown());

            context.LoadFixture(fixture2, new StubTestPart());
            fixture1.AssertWasNotCalled(x => x.TearDown());
            fixture2.AssertWasNotCalled(x => x.TearDown());

            context.RevertFixture(new StubTestPart());
            fixture1.AssertWasNotCalled(x => x.TearDown());
            fixture2.AssertWasCalled(x => x.TearDown());

            context.RevertFixture(new StubTestPart());
            fixture1.AssertWasCalled(x => x.TearDown());
        }
开发者ID:DarthFubuMVC,项目名称:storyteller,代码行数:20,代码来源:TestContextTester.cs


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