mirror of
https://github.com/iLoveElysia/openbilibili.git
synced 2026-06-08 05:58:29 -05:00
28 lines
582 B
Go
28 lines
582 B
Go
|
|
package service
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"testing"
|
||
|
|
|
||
|
|
"go-common/app/interface/main/space/model"
|
||
|
|
|
||
|
|
. "github.com/smartystreets/goconvey/convey"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestService_Article(t *testing.T) {
|
||
|
|
Convey("article list test", t, WithService(func(s *Service) {
|
||
|
|
mid := int64(442549)
|
||
|
|
pn := 1
|
||
|
|
ps := 10
|
||
|
|
sort := model.ArticleSortType["publish_time"]
|
||
|
|
res, err := s.Article(context.Background(), mid, pn, ps, sort)
|
||
|
|
So(err, ShouldBeNil)
|
||
|
|
if res != nil && len(res.Articles) > 0 {
|
||
|
|
Print(len(res.Articles), res.Count)
|
||
|
|
for _, v := range res.Articles {
|
||
|
|
Printf("%+v", v)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}))
|
||
|
|
}
|