client_test.go 927 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package api
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. var client MemberClient
  8. func init() {
  9. var err error
  10. client, err = NewClient(nil)
  11. if err != nil {
  12. panic(err)
  13. }
  14. }
  15. func TestUserDetails(t *testing.T) {
  16. convey.Convey("Block User Details", t, func(ctx convey.C) {
  17. var c = context.Background()
  18. ctx.Convey("When get block user details", func(ctx convey.C) {
  19. details, err := client.BlockBatchDetail(c, &MemberMidsReq{Mids: []int64{2, 3}})
  20. ctx.So(err, convey.ShouldBeNil)
  21. ctx.So(details, convey.ShouldNotBeNil)
  22. })
  23. })
  24. }
  25. func TestUserInfo(t *testing.T) {
  26. convey.Convey("Block User Infos", t, func(ctx convey.C) {
  27. var c = context.Background()
  28. ctx.Convey("When get block user infos", func(ctx convey.C) {
  29. infos, err := client.BlockBatchInfo(c, &MemberMidsReq{Mids: []int64{2}})
  30. ctx.So(err, convey.ShouldBeNil)
  31. ctx.So(infos, convey.ShouldNotBeNil)
  32. })
  33. })
  34. }