本文整理汇总了C#中Search.Users方法的典型用法代码示例。如果您正苦于以下问题:C# Search.Users方法的具体用法?C# Search.Users怎么用?C# Search.Users使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Search
的用法示例。
在下文中一共展示了Search.Users方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: User_PageSizeNotSpecified_UseDefault
public void User_PageSizeNotSpecified_UseDefault()
{
var extension = new Search(PortalApplication.Object);
PortalApplication.Setup(m => m.ViewManager.GetView("Users").Query(It.IsAny<IQuery>()));
extension.Users("");
PortalApplication.Verify(m => m.ViewManager.GetView("Users").Query(It.Is<IQuery>(q => q.PageSize == 10)));
}
示例2: User_GivenQuery_ReturnListFromView
public void User_GivenQuery_ReturnListFromView()
{
var extension = new Search(PortalApplication.Object);
var expected = new PagedResult<IResult>(0, 0, null);
PortalApplication.Setup(m => m.ViewManager.GetView("Users").Query(It.IsAny<IQuery>())).Returns(expected);
var actual = extension.Users("query");
Assert.That(actual, Is.SameAs(expected));
}
示例3: User_UppercaseQuery_QueryIsMadeLowerCase
public void User_UppercaseQuery_QueryIsMadeLowerCase()
{
var extension = new Search(PortalApplication.Object);
var query = "Firstname";
PortalApplication.Setup(m => m.ViewManager.GetView("Users").Query(It.IsAny<IQuery>()));
extension.Users(query);
var expected = "(Name:firstname*)(Name_split:firstname*)";
PortalApplication.Verify(m => m.ViewManager.GetView("Users").Query(It.Is<IQuery>(q => q.Query == expected)));
}
示例4: User_GivenNameWithSpaces_SendQUeryToView
public void User_GivenNameWithSpaces_SendQUeryToView()
{
var extension = new Search(PortalApplication.Object);
var query = "firstname lastname";
PortalApplication.Setup(m => m.ViewManager.GetView("Users").Query(It.IsAny<IQuery>()));
extension.Users(query);
var expected = "(Name:firstname\\ lastname*)(Name_split:firstname\\ lastname*)";
PortalApplication.Verify(m => m.ViewManager.GetView("Users").Query(It.Is<IQuery>(q => q.Query == expected)));
}