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


C# Routes.RouteParameters类代码示例

本文整理汇总了C#中FubuMVC.Core.Registration.Routes.RouteParameters的典型用法代码示例。如果您正苦于以下问题:C# RouteParameters类的具体用法?C# RouteParameters怎么用?C# RouteParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RouteParameters类属于FubuMVC.Core.Registration.Routes命名空间,在下文中一共展示了RouteParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: is_satisfied_positive

        public void is_satisfied_positive()
        {
            var parameters = new RouteParameters<FakeInput>();
            parameters[x => x.Code] = "something";

            _parameter.IsSatisfied(parameters).ShouldBeTrue();
        }
开发者ID:GunioRobot,项目名称:fubumvc,代码行数:7,代码来源:RouteInputTester.cs

示例2: to_query_string_from_route_parameter_with_a_value

        public void to_query_string_from_route_parameter_with_a_value()
        {
            var parameters = new RouteParameters<FakeInput>();
            parameters[x => x.Code] = "something";

            _parameter.ToQueryString(parameters).ShouldEqual("Code=something");
        }
开发者ID:GunioRobot,项目名称:fubumvc,代码行数:7,代码来源:RouteInputTester.cs

示例3: resolve_a_url_with_route_params_explicitly_filled

        public void resolve_a_url_with_route_params_explicitly_filled()
        {
            var values = new RouteParameters();
            values["Name"] = "Joel";

            theUrlResolver.UrlFor(theChainWithRouteParams, values).ShouldBe("/Joel");
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:7,代码来源:ChainUrlResolverTester.cs

示例4: is_satisfied_with_a_default_value_but_nothing_in_the_parameters

        public void is_satisfied_with_a_default_value_but_nothing_in_the_parameters()
        {
            var parameters = new RouteParameters<FakeInput>();

            _parameter.DefaultValue = "something";

            _parameter.IsSatisfied(parameters).ShouldBeTrue();
        }
开发者ID:GunioRobot,项目名称:fubumvc,代码行数:8,代码来源:RouteInputTester.cs

示例5: create_link_by_identifier

        public void create_link_by_identifier()
        {
            theLinks.ToSubject(x => x.Id);

            var parameters = new RouteParameters<Site>();
            parameters[x => x.Id] = theSubject.Id.ToString();

            theLinks.As<ILinkSource<Site>>().LinksFor(theTarget, theUrls)
                .Single().Url.ShouldEqual(theUrls.UrlFor(typeof(Site), parameters));
        }
开发者ID:ahjohannessen,项目名称:FubuMVC.Media,代码行数:10,代码来源:LinksSourceTester.cs

示例6: create_a_link_by_using_route_parameters

        public void create_a_link_by_using_route_parameters()
        {
            theLinks.ToInput<SiteAction>(x => x.Name);

            var parameters = new RouteParameters<SiteAction>();
            parameters["Name"] = theSubject.Name;

            theLinks.As<ILinkSource<Site>>().LinksFor(theTarget, theUrls)
                .Single().Url.ShouldEqual(theUrls.UrlFor(parameters));
        }
开发者ID:ahjohannessen,项目名称:FubuMVC.Media,代码行数:10,代码来源:LinksSourceTester.cs

示例7: the_route_has_route_input

        public void the_route_has_route_input()
        {
            var input = theChain.Route.Input.ShouldBeOfType<RouteInput<MethodInput>>();
            input.ShouldNotBeNull();

            var parameters = new RouteParameters();
            parameters["Start"] = "2";
            parameters["End"] = "5";

            input.CreateUrlFromParameters(parameters).ShouldEqual("cases/from/2/to/5");
        }
开发者ID:loudej,项目名称:fubumvc,代码行数:11,代码来源:MethodToUrlBuilderTester.cs

示例8: should_constrain_routes_by_MethodToUrlBuilder_if_they_match

        public void should_constrain_routes_by_MethodToUrlBuilder_if_they_match()
        {
            var input = _policy.Build(HandlersObjectMother.HandlerWithRouteInput()).Input;
            var parameters = new RouteParameters();
            parameters["Year"] = "2011";
            parameters["Month"] = "7";
            parameters["Title"] = "hello-world";

            input
                .CreateUrlFromParameters(parameters)
                .ShouldEqual("posts/2011/7/hello-world");
        }
开发者ID:RobertTheGrey,项目名称:FubuMVC.HandlerConventions,代码行数:12,代码来源:HandlersUrlPolicyTester.cs

示例9: create_url_with_parameters

        public void create_url_with_parameters()
        {
            var url = new RouteInput<SampleViewModel>("test/edit/{InPath}");
            url.AddRouteInput(x => x.InPath);

            var parameters = new RouteParameters<SampleViewModel>();
            parameters[x => x.InPath] = "5";

            url.CreateUrlFromParameters(parameters).ShouldEqual("test/edit/5");
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:10,代码来源:RouteDefinitionTester.cs

示例10: create_url_with_null_input_model_and_no_default_value_specified_for_optional_input_with_parameters

        public void create_url_with_null_input_model_and_no_default_value_specified_for_optional_input_with_parameters()
        {
            var url = new RouteInput<SampleViewModelWithInputs>("test/edit/{OptionalInput}");
            url.AddRouteInput(x => x.OptionalInput);

            var parameters = new RouteParameters<SampleViewModelWithInputs>();

            url
                .CreateUrlFromParameters(parameters)
                .ShouldEndWith("test/edit/default");
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:11,代码来源:RouteDefinitionTester.cs

示例11: create_url_with_multiple_variables_in_path_by_parameters

        public void create_url_with_multiple_variables_in_path_by_parameters()
        {
            var url = new RouteInput<SampleViewModel>("test/edit/{InPath}/{AlsoInPath}");
            url.AddRouteInput(x => x.InPath);
            url.AddRouteInput(x => x.AlsoInPath);

            var parameters = new RouteParameters<SampleViewModel>();
            parameters[x => x.InPath] = "5";
            parameters[x => x.AlsoInPath] = "some text";

            url.CreateUrlFromParameters(parameters).ShouldEqual("test/edit/5/some%20text");
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:12,代码来源:RouteDefinitionTester.cs

示例12: create_url_with_input_model_and_default_value_for_required_input_by_parameters

        public void create_url_with_input_model_and_default_value_for_required_input_by_parameters()
        {
            var url = new RouteInput<SampleViewModelWithInputs>("test/edit/{RequiredInput}");
            url.AddRouteInput(x => x.RequiredInput);

            var parameters = new RouteParameters<SampleViewModelWithInputs>();
            parameters[x => x.RequiredInput] = "a";

            url
                .CreateUrlFromParameters(parameters)
                .ShouldEndWith("test/edit/a");
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:12,代码来源:RouteDefinitionTester.cs

示例13: can_substitute_greedy_parameters

 public void can_substitute_greedy_parameters()
 {
     var parameters = new RouteParameters<FakeInput>();
     parameters[x => x.Code] = "computers/laptop/i7/dell&ibm";
     _parameter.Substitute(parameters, "product/category/{*Code}").ShouldEqual("product/category/computers/laptop/i7/dell%26ibm");
 }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:6,代码来源:RouteInputTester.cs

示例14: IsSatisfied

 public bool IsSatisfied(RouteParameters routeParameters)
 {
     return routeParameters.Has(_accessor.Name) || DefaultValue != null;
 }
开发者ID:jemacom,项目名称:fubumvc,代码行数:4,代码来源:RouteParameter.cs

示例15: to_query_string_from_route_parameter_with_an_encoded_value

        public void to_query_string_from_route_parameter_with_an_encoded_value()
        {
            var parameters = new RouteParameters<FakeInput>();
            parameters[x => x.Code] = "abc/def&ghi=jkl";

            _parameter.ToQueryString(parameters).ShouldEqual("Code=abc%2Fdef%26ghi%3Djkl");
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:7,代码来源:RouteInputTester.cs


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