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


C# ChainSearch.FindForCategory方法代码示例

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


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

示例1: find_by_category_when_the_category_is_null_and_relaxed_search_and_only_one_chain

        public void find_by_category_when_the_category_is_null_and_relaxed_search_and_only_one_chain()
        {
            var search = new ChainSearch{
                CategoryMode = CategorySearchMode.Relaxed,
                CategoryOrHttpMethod = null
            };

            var chains = new BehaviorChain[]{new BehaviorChain(),};

            search.FindForCategory(chains).Single().ShouldBeTheSameAs(chains.Single());
        }
开发者ID:DarthFubuMVC,项目名称:fubumvc,代码行数:11,代码来源:ChainSearchTester.cs

示例2: find_by_category_when_the_category_is_null_and_relaxed_search_and_only_one_chain_2

        public void find_by_category_when_the_category_is_null_and_relaxed_search_and_only_one_chain_2()
        {
            var search = new ChainSearch
            {
                CategoryMode = CategorySearchMode.Relaxed,
                CategoryOrHttpMethod = null
            };

            var chain1 = new RoutedChain("something");
            chain1.UrlCategory.Category = Categories.DEFAULT;

            var chains = new BehaviorChain[] { chain1, };

            search.FindForCategory(chains).Single().ShouldBeTheSameAs(chains.Single());
        }
开发者ID:DarthFubuMVC,项目名称:fubumvc,代码行数:15,代码来源:ChainSearchTester.cs

示例3: find_by_category_relaxed_with_only_one_chain

        public void find_by_category_relaxed_with_only_one_chain()
        {
            var search = new ChainSearch
            {
                CategoryMode = CategorySearchMode.Relaxed,
                CategoryOrHttpMethod = "something"
            };

            var chain3 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = null
                }
            };

            var chains = new BehaviorChain[] { chain3 };

            search.FindForCategory(chains).ShouldHaveTheSameElementsAs(chain3);
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:20,代码来源:ChainSearchTester.cs

示例4: find_by_category_strict_with_multiple_chains_2

        public void find_by_category_strict_with_multiple_chains_2()
        {
            var search = new ChainSearch
            {
                CategoryMode = CategorySearchMode.Strict,
                CategoryOrHttpMethod = "something"
            };

            var chain1 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = "different"
                }
            };

            var chain2 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = Categories.DEFAULT
                }
            };

            var chain3 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = "else"
                }
            };

            var chains = new BehaviorChain[] { chain1, chain2, chain3 };

            search.FindForCategory(chains).Any().ShouldBeFalse();
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:36,代码来源:ChainSearchTester.cs

示例5: find_by_category_strict_with_multiple_chains_1

        public void find_by_category_strict_with_multiple_chains_1()
        {
            var search = new ChainSearch
            {
                CategoryMode = CategorySearchMode.Strict,
                CategoryOrHttpMethod = "something"
            };

            var chain1 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = "something"
                }
            };

            var chain2 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = Categories.DEFAULT
                }
            };

            var chain3 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = null
                }
            };

            var chains = new BehaviorChain[] { chain1, chain2, chain3 };

            search.FindForCategory(chains).ShouldHaveTheSameElementsAs(chain1);
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:36,代码来源:ChainSearchTester.cs

示例6: find_by_null_category_with_multiple_chains_but_only_one_is_default_3

        public void find_by_null_category_with_multiple_chains_but_only_one_is_default_3()
        {
            var search = new ChainSearch
            {
                CategoryMode = CategorySearchMode.Relaxed,
                CategoryOrHttpMethod = null
            };

            var chain1 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = "something"
                }
            };

            var chain2 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = Categories.DEFAULT
                }
            };

            var chain3 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = Categories.DEFAULT
                }
            };

            var chains = new BehaviorChain[] { chain1, chain2, chain3 };

            search.FindForCategory(chains).ShouldHaveTheSameElementsAs(chain2, chain3);
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:36,代码来源:ChainSearchTester.cs

示例7: find_by_null_category_with_multiple_chains_but_only_one_is_default

        public void find_by_null_category_with_multiple_chains_but_only_one_is_default()
        {
            var search = new ChainSearch
            {
                CategoryMode = CategorySearchMode.Relaxed,
                CategoryOrHttpMethod = null
            };

            var chain1 = new RoutedChain(""){
                UrlCategory ={
                    Category = null
                }
            };

            var chain2 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = Categories.DEFAULT
                }
            };

            var chains = new BehaviorChain[] { chain1, chain2};

            search.FindForCategory(chains).Single().ShouldBeTheSameAs(chain2);
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:26,代码来源:ChainSearchTester.cs

示例8: find_by_category_strict_with_only_one_chain_that_does_not_match_still_returns_nothing

        public void find_by_category_strict_with_only_one_chain_that_does_not_match_still_returns_nothing()
        {
            var search = new ChainSearch
            {
                CategoryMode = CategorySearchMode.Strict,
                CategoryOrHttpMethod = "something"
            };

            var chain3 = new RoutedChain("")
            {
                UrlCategory =
                {
                    Category = null
                }
            };

            var chains = new BehaviorChain[] { chain3 };

            search.FindForCategory(chains).Any().ShouldBeFalse();
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:20,代码来源:ChainSearchTester.cs

示例9: find_by_null_category_with_multiple_chains_but_none_is_marked_default

        public void find_by_null_category_with_multiple_chains_but_none_is_marked_default()
        {
            var search = new ChainSearch
            {
                CategoryMode = CategorySearchMode.Relaxed,
                CategoryOrHttpMethod = null
            };

            var chain1 = new BehaviorChain
            {
                UrlCategory =
                {
                    Category = "something"
                }
            };

            var chain2 = new BehaviorChain
            {
                UrlCategory =
                {
                    Category = "else"
                }
            };

            var chain3 = new BehaviorChain
            {
                UrlCategory =
                {
                    Category = null
                }
            };

            var chains = new BehaviorChain[] { chain1, chain2, chain3 };

            search.FindForCategory(chains).ShouldHaveTheSameElementsAs(chain3);
        }
开发者ID:roend83,项目名称:fubumvc,代码行数:36,代码来源:ChainSearchTester.cs

示例10: find_by_category_strict_with_multiple_chains_by_method

        public void find_by_category_strict_with_multiple_chains_by_method()
        {
            var search = new ChainSearch
            {
                CategoryMode = CategorySearchMode.Strict,
                CategoryOrHttpMethod = "POST"
            };

            var chain1 = new BehaviorChain
            {
                Route = new RouteDefinition("whatever"),
                UrlCategory =
                {
                    Category = "something"
                }
            };

            chain1.Route.AllowedHttpMethods.Add("POST");

            var chain2 = new BehaviorChain
            {
                UrlCategory =
                {
                    Category = Categories.DEFAULT
                }
            };

            var chain3 = new BehaviorChain
            {
                UrlCategory =
                {
                    Category = null
                }
            };

            var chains = new BehaviorChain[] { chain1, chain2, chain3 };

            search.FindForCategory(chains).ShouldHaveTheSameElementsAs(chain1);
        }
开发者ID:roend83,项目名称:fubumvc,代码行数:39,代码来源:ChainSearchTester.cs


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