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


C# TestContext.Retrieve方法代码示例

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


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

示例1: the_test_is_available_in_the_test_context

        public void the_test_is_available_in_the_test_context()
        {
            var test = new Test("some test");
            var context = new TestContext(new Container(), test, new ConsoleListener());

            context.Retrieve<Test>().ShouldBeTheSameAs(test);
        }
开发者ID:DarthFubuMVC,项目名称:storyteller,代码行数:7,代码来源:TestContextTester.cs

示例2: store_and_retrieve_backs_up_by_the_system

        public void store_and_retrieve_backs_up_by_the_system()
        {
            var returnValue = new SomethingThatDoesNotExist();

            var context = new TestContext()
            {
                BackupResolver = t =>
                {
                    if (t == typeof(ISomethingThatDoesNotExist)) return returnValue;

                    throw new ApplicationException("Unexpected Type:  " + t.FullName);
                }
            };

            context.Retrieve(typeof (ISomethingThatDoesNotExist)).ShouldBeTheSameAs(returnValue);
            context.Retrieve<ISomethingThatDoesNotExist>().ShouldBeTheSameAs(returnValue);
        }
开发者ID:DarthFubuMVC,项目名称:storyteller,代码行数:17,代码来源:TestContextTester.cs

示例3: store_and_retrieve

        public void store_and_retrieve()
        {
            var context = new TestContext();
            var data = new SomeContext();

            context.Store(data);

            context.Retrieve<SomeContext>().ShouldBeTheSameAs(data);
        }
开发者ID:DarthFubuMVC,项目名称:storyteller,代码行数:9,代码来源:TestContextTester.cs

示例4: store_and_retrieve_backs_up_by_the_system

        public void store_and_retrieve_backs_up_by_the_system()
        {
            var returnValue = new SomethingThatDoesNotExist();

            var execution = new SimpleExecutionContext();
            execution.Services.Add<ISomethingThatDoesNotExist>(returnValue);
            var context = new TestContext(execution, new Test("a"), new ConsoleListener());

            context.Retrieve(typeof (ISomethingThatDoesNotExist)).ShouldBeTheSameAs(returnValue);
            context.Retrieve<ISomethingThatDoesNotExist>().ShouldBeTheSameAs(returnValue);
        }
开发者ID:GaryLCoxJr,项目名称:StoryTeller2,代码行数:11,代码来源:TestContextTester.cs

示例5: retrieving_ITestContext_always_returns_itself

 public void retrieving_ITestContext_always_returns_itself()
 {
     var context = new TestContext();
     context.Retrieve<ITestContext>().ShouldBeTheSameAs(context);
 }
开发者ID:GaryLCoxJr,项目名称:StoryTeller2,代码行数:5,代码来源:TestContextTester.cs

示例6: can_retrieve_its_own_test

        public void can_retrieve_its_own_test()
        {
            var execution = new SimpleExecutionContext();
            var test = new Test("soemthing");
            var context = new TestContext(execution, test, new ConsoleListener());

            context.Retrieve(typeof (Test)).ShouldBeTheSameAs(test);
            context.Retrieve<Test>().ShouldBeTheSameAs(test);
        }
开发者ID:GaryLCoxJr,项目名称:StoryTeller2,代码行数:9,代码来源:TestContextTester.cs


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