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


C# ControllerBuilder.GetControllerFactory方法代码示例

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


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

示例1: Should_be_able_to_register_controller_factory

        public void Should_be_able_to_register_controller_factory()
        {
            var builder = new ControllerBuilder();

            new RegisterControllerFactory(adapter.Object, builder).Execute();

            Assert.Same(controllerFactory.Object, builder.GetControllerFactory());
        }
开发者ID:rootzhou,项目名称:Core,代码行数:8,代码来源:RegisterControllerFactoryTests.cs

示例2: ControllerBuilderReturnsDefaultControllerBuilderByDefault

        public void ControllerBuilderReturnsDefaultControllerBuilderByDefault() {
            // Arrange
            ControllerBuilder cb = new ControllerBuilder();

            // Act
            IControllerFactory cf = cb.GetControllerFactory();

            // Assert
            Assert.IsInstanceOfType(cf, typeof(DefaultControllerFactory));
        }
开发者ID:pruiz,项目名称:AspMvc2,代码行数:10,代码来源:ControllerBuilderTest.cs

示例3: Should_not_register_controller_factory_when_excluded

        public void Should_not_register_controller_factory_when_excluded()
        {
            RegisterControllerFactory.Excluded = true;
            DependencyResolver.SetResolver(null);

            var builder = new ControllerBuilder();

            new RegisterControllerFactory(adapter.Object, builder).Execute();

            Assert.NotSame(controllerFactory.Object, builder.GetControllerFactory());
        }
开发者ID:rootzhou,项目名称:Core,代码行数:11,代码来源:RegisterControllerFactoryTests.cs

示例4: CreateControllerWithFactoryTypeReturnsValidType

        public void CreateControllerWithFactoryTypeReturnsValidType() {
            // Arrange
            ControllerBuilder cb = new ControllerBuilder();
            cb.SetControllerFactory(typeof(MockControllerFactory));

            // Act
            IControllerFactory cf = cb.GetControllerFactory();

            // Assert
            Assert.IsInstanceOfType(cf, typeof(MockControllerFactory));
        }
开发者ID:pruiz,项目名称:AspMvc2,代码行数:11,代码来源:ControllerBuilderTest.cs

示例5: CreateControllerWithFactoryInstanceReturnsInstance

        public void CreateControllerWithFactoryInstanceReturnsInstance() {
            // Arrange
            ControllerBuilder cb = new ControllerBuilder();
            DefaultControllerFactory factory = new DefaultControllerFactory();
            cb.SetControllerFactory(factory);

            // Act
            IControllerFactory cf = cb.GetControllerFactory();

            // Assert
            Assert.AreSame(factory, cf);
        }
开发者ID:pruiz,项目名称:AspMvc2,代码行数:12,代码来源:ControllerBuilderTest.cs

示例6: ControllerBuilderGetControllerFactoryDelegatesToResolver

        public void ControllerBuilderGetControllerFactoryDelegatesToResolver() {
            //Arrange
            Mock<IControllerFactory> factory = new Mock<IControllerFactory>();
            Resolver<IControllerFactory> resolver = new Resolver<IControllerFactory> { Current = factory.Object };
            ControllerBuilder builder = new ControllerBuilder(resolver);

            //Act
            IControllerFactory result = builder.GetControllerFactory();

            //Assert
            Assert.AreSame(factory.Object, result);

        }
开发者ID:adrianvallejo,项目名称:MVC3_Source,代码行数:13,代码来源:ControllerBuilderTest.cs

示例7: SettingControllerFactoryReturnsSetFactory

        public void SettingControllerFactoryReturnsSetFactory() {
            // Arrange
            ControllerBuilder builder = new ControllerBuilder();
            Mock<IControllerFactory> setFactory = new Mock<IControllerFactory>();

            // Act
            builder.SetControllerFactory(setFactory.Object);

            // Assert
            Assert.AreSame(setFactory.Object, builder.GetControllerFactory());
        }
开发者ID:adrianvallejo,项目名称:MVC3_Source,代码行数:11,代码来源:ControllerBuilderTest.cs

示例8: DefaultControllerFactoryIsDefaultControllerFactory

        public void DefaultControllerFactoryIsDefaultControllerFactory() {
            // Arrange
            ControllerBuilder builder = new ControllerBuilder();

            // Act
            IControllerFactory returnedControllerFactory = builder.GetControllerFactory();

            //Assert
            Assert.AreEqual(typeof(DefaultControllerFactory), returnedControllerFactory.GetType());
        }
开发者ID:adrianvallejo,项目名称:MVC3_Source,代码行数:10,代码来源:ControllerBuilderTest.cs


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