vip_test.go 844 B

123456789101112131415161718192021222324252627282930313233343536
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoRawVip(t *testing.T) {
  8. var (
  9. c = context.TODO()
  10. mid = int64(110018671)
  11. )
  12. convey.Convey("Get vip-info from vip-rpc", t, func(ctx convey.C) {
  13. vip, err := d.RawVip(c, mid)
  14. ctx.Convey("Then err should be nil and vip should not be nil.", func(ctx convey.C) {
  15. ctx.So(err, convey.ShouldBeNil)
  16. ctx.So(vip, convey.ShouldNotBeNil)
  17. })
  18. })
  19. }
  20. func TestDaoRawVips(t *testing.T) {
  21. var (
  22. c = context.TODO()
  23. mids = []int64{110016841, 110018671}
  24. )
  25. convey.Convey("Batch get vip-infos from vip-rpc", t, func(ctx convey.C) {
  26. res, err := d.RawVips(c, mids)
  27. ctx.Convey("Then err should be nil and res should not be nil.", func(ctx convey.C) {
  28. ctx.So(err, convey.ShouldBeNil)
  29. ctx.So(res, convey.ShouldNotBeNil)
  30. })
  31. })
  32. }