示例#1
0
        public void SearchPoets_Test()
        {
            // Act
            var output = _appService.SearchPoets(new SearchPoetDto {
                Keyword = "李", MaxResultCount = 20, SkipCount = 0
            });

            // Assert
            output.Items.Count.ShouldBe(1);

            output.Items[0].Name.ShouldBe("李白");
        }
示例#2
0
        /// <summary>
        /// 响应Http Get
        /// </summary>
        /// <param name="SearchString">
        /// 查询的关键字
        /// </param>
        /// <param name="pageIndex">
        /// 页面Index
        /// </param>
        public void OnGet(string SearchString, int?pageIndex)
        {
            if (pageIndex.HasValue && pageIndex.Value > 0)
            {
                CurrentPage = pageIndex.Value;
            }
            CurrentFilter = SearchString;
            var req = new SearchPoetDto
            {
                Keyword        = CurrentFilter,
                SkipCount      = CurrentPage * PageSize,
                MaxResultCount = PageSize
            };

            poetResults = _appService.SearchPoets(req);
        }