account_test.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package global
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestGlobalGetInfo(t *testing.T) {
  8. convey.Convey("GetInfo", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. mid = int64(417851)
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. res, err := GetInfo(c, mid)
  15. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(res, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestGlobalGetInfos(t *testing.T) {
  23. convey.Convey("GetInfos", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. mid = []int64{417851}
  27. )
  28. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  29. res, err := GetInfos(c, mid)
  30. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  31. ctx.So(err, convey.ShouldBeNil)
  32. ctx.So(res, convey.ShouldNotBeNil)
  33. })
  34. })
  35. })
  36. }
  37. func TestGlobalGetName(t *testing.T) {
  38. convey.Convey("GetName", t, func(ctx convey.C) {
  39. var (
  40. c = context.Background()
  41. mid = int64(0)
  42. )
  43. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  44. nickname := GetName(c, mid)
  45. ctx.Convey("Then nickname should not be nil.", func(ctx convey.C) {
  46. ctx.So(nickname, convey.ShouldNotBeNil)
  47. })
  48. })
  49. })
  50. }