user_card_test.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoRawUserCard(t *testing.T) {
  8. convey.Convey("RawUserCard", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. mid = int64(88895104)
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. userCard, err := d.RawUserCard(c, mid)
  15. ctx.Convey("Then err should be nil.userCard should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(userCard, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestDaoRawUserCards(t *testing.T) {
  23. convey.Convey("RawUserCards", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. mids = []int64{88895104}
  27. )
  28. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  29. userCards, err := d.RawUserCards(c, mids)
  30. ctx.Convey("Then err should be nil.userCards should not be nil.", func(ctx convey.C) {
  31. ctx.So(err, convey.ShouldBeNil)
  32. ctx.So(userCards, convey.ShouldNotBeNil)
  33. })
  34. })
  35. })
  36. }
  37. func TestDaoRawUserAccCards(t *testing.T) {
  38. convey.Convey("RawUserAccCards", t, func(ctx convey.C) {
  39. var (
  40. c = context.Background()
  41. mids = []int64{88895104}
  42. )
  43. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  44. res, err := d.RawUserAccCards(c, mids)
  45. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  46. ctx.So(err, convey.ShouldBeNil)
  47. ctx.So(res, convey.ShouldNotBeNil)
  48. })
  49. })
  50. })
  51. }