bcoin_test.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/service/main/vip/model"
  5. "testing"
  6. "time"
  7. "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestDaoBcoinSalaryList(t *testing.T) {
  10. var (
  11. c = context.TODO()
  12. mid = int64(0)
  13. start = time.Now()
  14. end = time.Now()
  15. expRes []*model.VipBcoinSalary
  16. )
  17. convey.Convey("BcoinSalaryList", t, func(ctx convey.C) {
  18. res, err := d.BcoinSalaryList(c, mid, start, end)
  19. ctx.Convey("Error should be nil", func(ctx convey.C) {
  20. ctx.So(err, convey.ShouldBeNil)
  21. })
  22. ctx.Convey("res should not be nil", func(ctx convey.C) {
  23. ctx.So(res, convey.ShouldEqual, expRes)
  24. })
  25. })
  26. }
  27. func TestDaoSelLastBcoin(t *testing.T) {
  28. var (
  29. c = context.TODO()
  30. mid = int64(20606508)
  31. )
  32. convey.Convey("SelLastBcoin", t, func(ctx convey.C) {
  33. _, err := d.SelLastBcoin(c, mid)
  34. ctx.Convey("Error should be nil", func(ctx convey.C) {
  35. ctx.So(err, convey.ShouldBeNil)
  36. })
  37. })
  38. }
  39. func TestDaoInsertVipBcoinSalary(t *testing.T) {
  40. var (
  41. c = context.TODO()
  42. r = &model.VipBcoinSalary{}
  43. )
  44. convey.Convey("InsertVipBcoinSalary", t, func(ctx convey.C) {
  45. err := d.InsertVipBcoinSalary(c, r)
  46. ctx.Convey("Error should be nil", func(ctx convey.C) {
  47. ctx.So(err, convey.ShouldBeNil)
  48. })
  49. })
  50. }