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


C# SearchModel.IsValidSearchCombination方法代码示例

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


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

示例1: TestSearchEmpty

 public void TestSearchEmpty()
 {
     SearchModel<Status> model = new SearchModel<Status>();
     SearchValidationResult res = model.IsValidSearchCombination();
     Assert.False(res.IsValid);
     Assert.AreEqual(StringResource.NO_VALUES_TO_SEARCH, res.Description);
 }
开发者ID:stampr,项目名称:stampr-api-csharp,代码行数:7,代码来源:SearchTest.cs

示例2: TestSearchMissingStartTime

        public void TestSearchMissingStartTime()
        {
            DateTime date = DateTime.Now;
            SearchModel<Status> model = new SearchModel<Status>()
            {
                Status = Status.hold,
                End = date.AddMinutes(5)
            };

            SearchValidationResult res = model.IsValidSearchCombination();
            Assert.False(res.IsValid);
            Assert.AreEqual(StringResource.START_VALUE_SHOULD_BE_SPECIFIED, res.Description);
        }
开发者ID:stampr,项目名称:stampr-api-csharp,代码行数:13,代码来源:SearchTest.cs

示例3: TestSearchMissingEndTimeForPaging

        public void TestSearchMissingEndTimeForPaging()
        {
            DateTime date = DateTime.Now;
            SearchModel<Status> model = new SearchModel<Status>()
            {
                Start = date,
                Paging = 10
            };

            SearchValidationResult res = model.IsValidSearchCombination();
            Assert.False(res.IsValid);
            Assert.AreEqual(StringResource.START_END_VALUES_SHOULD_BE_SPECIFIED, res.Description);
        }
开发者ID:stampr,项目名称:stampr-api-csharp,代码行数:13,代码来源:SearchTest.cs

示例4: TestSearchValidAll

        public void TestSearchValidAll()
        {
            DateTime date = DateTime.Now;

            SearchModel<Status> model = new SearchModel<Status>()
            {
                Status = Status.hold,
                End = date.AddMinutes(5),
                Start = date,
                Paging = 10
            };

            SearchValidationResult res = model.IsValidSearchCombination();
            Assert.True(res.IsValid);
            string[] searchArray = model.PropertiesToSearch();
            Assert.AreEqual("with", searchArray[0]);
            Assert.AreEqual(Status.hold.ToString(), searchArray[1]);
            Assert.AreEqual(date.ToUniversalTime().ToString(_dateFormat), searchArray[2]);
            Assert.AreEqual(date.ToUniversalTime().AddMinutes(5).ToString(_dateFormat), searchArray[3]);
            Assert.AreEqual("10", searchArray[4]);
        }
开发者ID:stampr,项目名称:stampr-api-csharp,代码行数:21,代码来源:SearchTest.cs

示例5: TestSearchValidStatus

        public void TestSearchValidStatus()
        {
            SearchModel<Status> model = new SearchModel<Status>()
            {
                Status = Status.hold
            };

            SearchValidationResult res = model.IsValidSearchCombination();
            Assert.True(res.IsValid);
            string[] searchArray = model.PropertiesToSearch();
            Assert.AreEqual("with", searchArray[0]);
            Assert.AreEqual(Status.hold.ToString(), searchArray[1]);
        }
开发者ID:stampr,项目名称:stampr-api-csharp,代码行数:13,代码来源:SearchTest.cs

示例6: TestSearchValidStartTime

        public void TestSearchValidStartTime()
        {
            DateTime date = DateTime.Now;
            SearchModel<Status> model = new SearchModel<Status>()
            {
                Start = date
            };

            SearchValidationResult res = model.IsValidSearchCombination();
            Assert.True(res.IsValid);
            string[] searchArray = model.PropertiesToSearch();
            Assert.AreEqual("browse", searchArray[0]);
            Assert.AreEqual(date.ToUniversalTime().ToString(_dateFormat), searchArray[1]);
        }
开发者ID:stampr,项目名称:stampr-api-csharp,代码行数:14,代码来源:SearchTest.cs


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