本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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]);
}
示例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]);
}
示例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]);
}