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


C# RouteCollection.MapAttributeRoutesInAssembly方法代码示例

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


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

示例1: Setup

        public void Setup()
        {
            RouteAssert.UseAssertEngine(new NunitAssertEngine());

            routes = new RouteCollection();
            routes.MapAttributeRoutesInAssembly(typeof(HomeAttrController));
        }
开发者ID:EricRohlfs,项目名称:MvcRouteTester,代码行数:7,代码来源:VerbedAttrControllerTests.cs

示例2: ArticlesMvcRouteTest

 public ArticlesMvcRouteTest()
 {
     //// Arrange
     testRoutes = new RouteCollection();
     testRoutes.MapAttributeRoutesInAssembly(typeof(ArticlesController));
     RouteConfig.RegisterRoutes(testRoutes);
 }
开发者ID:wuanunet,项目名称:UnitTest-MVC-Route,代码行数:7,代码来源:ArticlesMvcRouteTest.cs

示例3: CreateUrlHelper

        public static UrlHelper CreateUrlHelper()
        {
            var context = new Mock<HttpContextBase>();
            var request = new Mock<HttpRequestBase>();
            var response = new Mock<HttpResponseBase>();
            var session = new Mock<HttpSessionStateBase>();
            var server = new Mock<HttpServerUtilityBase>();

            context.Setup(ctx => ctx.Request).Returns(request.Object);
            context.Setup(ctx => ctx.Response).Returns(response.Object);
            context.Setup(ctx => ctx.Session).Returns(session.Object);
            context.Setup(ctx => ctx.Server).Returns(server.Object);

            request.SetupGet(x => x.ApplicationPath).Returns("/");
            request.SetupGet(x => x.Url).Returns(new Uri("http://localhost/a", UriKind.Absolute));
            request.SetupGet(x => x.ServerVariables).Returns(new NameValueCollection());

            response.Setup(x => x.ApplyAppPathModifier(It.IsAny<string>())).Returns<string>(x => x);

            context.SetupGet(x => x.Request).Returns(request.Object);
            context.SetupGet(x => x.Response).Returns(response.Object);

            var routes = new RouteCollection();
            routes.MapAttributeRoutesInAssembly(typeof(HomeController).Assembly);

            return new UrlHelper(new RequestContext(context.Object, new RouteData()), routes);
        }
开发者ID:spapaseit,项目名称:qoam,代码行数:27,代码来源:HttpContextHelper.cs

示例4: Setup

		public void Setup()
		{
			var defaultConstraintResolver = new DefaultInlineConstraintResolver();
			defaultConstraintResolver.ConstraintMap.Add("verb", typeof(CustomConstraint));

			routes = new RouteCollection();
			routes.MapAttributeRoutesInAssembly(typeof(WithAreaController).Assembly, defaultConstraintResolver);
		}
开发者ID:chimpinano,项目名称:MvcRouteTester,代码行数:8,代码来源:WithAreaTests.cs

示例5: Setup

        public void Setup()
        {
            assertEngine = new FakeAssertEngine();
            RouteAssert.UseAssertEngine(assertEngine);

            routes = new RouteCollection();
            routes.MapAttributeRoutesInAssembly(typeof(HomeAttrController));
        }
开发者ID:EricRohlfs,项目名称:MvcRouteTester,代码行数:8,代码来源:HomeAttrControllerFailTests.cs

示例6: Setup

		public void Setup()
		{
			RouteAssert.UseAssertEngine(new NunitAssertEngine());

			var defaultConstraintResolver = new DefaultInlineConstraintResolver();
			defaultConstraintResolver.ConstraintMap.Add("verb", typeof(CustomConstraint));

			routes = new RouteCollection();
			routes.MapAttributeRoutesInAssembly(typeof(HomeAttrController), defaultConstraintResolver);
		}
开发者ID:chimpinano,项目名称:MvcRouteTester,代码行数:10,代码来源:VerbedAttrControllerTests.cs

示例7: Setup

 public void Setup()
 {
     routes = new RouteCollection();
     routes.MapAttributeRoutesInAssembly(typeof(WithAreaController).Assembly);
 }
开发者ID:EricRohlfs,项目名称:MvcRouteTester,代码行数:5,代码来源:WithAreaTests.cs

示例8: Setup

 public void Setup()
 {
     routes = new RouteCollection();
     routes.MapAttributeRoutesInAssembly(typeof(HomeAttrController));
 }
开发者ID:EricRohlfs,项目名称:MvcRouteTester,代码行数:5,代码来源:RouteMethodTests.cs


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