bgm_income_stat_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package income
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestIncomeBgmIncomeStat(t *testing.T) {
  8. convey.Convey("BgmIncomeStat", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. id = int64(0)
  12. limit = int64(100)
  13. )
  14. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  15. m, last, err := d.BgmIncomeStat(c, id, limit)
  16. ctx.Convey("Then err should be nil.m,last should not be nil.", func(ctx convey.C) {
  17. ctx.So(err, convey.ShouldBeNil)
  18. ctx.So(last, convey.ShouldNotBeNil)
  19. ctx.So(m, convey.ShouldNotBeNil)
  20. })
  21. })
  22. })
  23. }
  24. func TestIncomeInsertBgmIncomeStat(t *testing.T) {
  25. convey.Convey("InsertBgmIncomeStat", t, func(ctx convey.C) {
  26. var (
  27. c = context.Background()
  28. values = "(100,200)"
  29. )
  30. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  31. rows, err := d.InsertBgmIncomeStat(c, values)
  32. ctx.Convey("Then err should be nil.rows should not be nil.", func(ctx convey.C) {
  33. ctx.So(err, convey.ShouldBeNil)
  34. ctx.So(rows, convey.ShouldNotBeNil)
  35. })
  36. })
  37. })
  38. }