You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.2 KiB
55 lines
1.2 KiB
package search |
|
|
|
import ( |
|
"context" |
|
"testing" |
|
|
|
mdlSearch "go-common/app/interface/main/tv/model/search" |
|
|
|
. "github.com/smartystreets/goconvey/convey" |
|
) |
|
|
|
func TestService_UserSearch(t *testing.T) { |
|
Convey("test user search", t, WithService(func(s *Service) { |
|
arg := &mdlSearch.UserSearch{ |
|
Keyword: "lex", |
|
Build: "111", |
|
SearchType: "all", |
|
Page: 1, |
|
Pagesize: 20, |
|
} |
|
res, err := s.UserSearch(context.Background(), arg) |
|
So(err, ShouldBeNil) |
|
So(len(res), ShouldNotBeEmpty) |
|
})) |
|
} |
|
|
|
func TestService_SearchAll(t *testing.T) { |
|
Convey("test search all", t, WithService(func(s *Service) { |
|
arg := &mdlSearch.UserSearch{ |
|
Keyword: "工作细胞", |
|
Build: "111", |
|
SearchType: "bili_user", |
|
Page: 1, |
|
Pagesize: 20, |
|
} |
|
res, err := s.SearchAll(context.Background(), arg) |
|
So(err, ShouldBeNil) |
|
So(res, ShouldNotBeEmpty) |
|
})) |
|
} |
|
|
|
func TestService_PgcSearch(t *testing.T) { |
|
Convey("test pgc search", t, WithService(func(s *Service) { |
|
arg := &mdlSearch.UserSearch{ |
|
Keyword: "工作细胞", |
|
Build: "111", |
|
SearchType: "all", |
|
Page: 1, |
|
Pagesize: 20, |
|
} |
|
res, err := s.PgcSearch(context.Background(), arg) |
|
So(err, ShouldBeNil) |
|
So(res, ShouldNotBeEmpty) |
|
})) |
|
}
|
|
|