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


C# RouteValueDictionary.WithRouteValue方法代码示例

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


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

示例1: WithRouteValue_ThrowIfValueTypeMismatch

        public void WithRouteValue_ThrowIfValueTypeMismatch()
        {
            var dict = new RouteValueDictionary();
            dict.Add("Existing", 1);

            Assert.Throws<ValueTypeMismatchException>(() => dict.WithRouteValue("Existing", "1"));
        }
开发者ID:mgmccarthy,项目名称:TestStack.FluentMVCTesting,代码行数:7,代码来源:RouteValueDictionaryExtensionsTests.cs

示例2: WithRouteValue_ThrowsWhenDictHasIncorrectValue

        public void WithRouteValue_ThrowsWhenDictHasIncorrectValue()
        {
            var dict = new RouteValueDictionary();
            dict.Add("Existing", "Correct");

            Assert.Throws<InvalidRouteValueException>(() => dict.WithRouteValue("Existing", "Incorrect"));
        }
开发者ID:mgmccarthy,项目名称:TestStack.FluentMVCTesting,代码行数:7,代码来源:RouteValueDictionaryExtensionsTests.cs

示例3: WithRouteValue_ThrowsWhenDictDoesntHaveValue

        public void WithRouteValue_ThrowsWhenDictDoesntHaveValue()
        {
            var dict = new RouteValueDictionary();
            dict.Add("Existing", "NotImportant");

            Assert.Throws<MissingRouteValueException>(() => dict.WithRouteValue("NotExisting"));
        }
开发者ID:mgmccarthy,项目名称:TestStack.FluentMVCTesting,代码行数:7,代码来源:RouteValueDictionaryExtensionsTests.cs

示例4: WithRouteValue_CanUseIntType

        public void WithRouteValue_CanUseIntType()
        {
            var dict = new RouteValueDictionary();
            dict.Add("Existing", 10);

            dict.WithRouteValue("Existing", 10);
            
             Assert.Pass();
        }
开发者ID:mgmccarthy,项目名称:TestStack.FluentMVCTesting,代码行数:9,代码来源:RouteValueDictionaryExtensionsTests.cs

示例5: WithRouteValue_DoesntThrowIfValueIsCorrect

        public void WithRouteValue_DoesntThrowIfValueIsCorrect()
        {
            var dict = new RouteValueDictionary();
            dict.Add("Existing", "Correct");

            dict.WithRouteValue("Existing", "Correct");

            Assert.Pass();
        }
开发者ID:mgmccarthy,项目名称:TestStack.FluentMVCTesting,代码行数:9,代码来源:RouteValueDictionaryExtensionsTests.cs

示例6: WithRouteValue_ThrowsWhenDictIsEmpty

        public void WithRouteValue_ThrowsWhenDictIsEmpty()
        {
            var dict = new RouteValueDictionary();

            Assert.Throws<MissingRouteValueException>(() => dict.WithRouteValue("NotImportant"));
        }
开发者ID:mgmccarthy,项目名称:TestStack.FluentMVCTesting,代码行数:6,代码来源:RouteValueDictionaryExtensionsTests.cs


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