archive_test.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package income
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestIncomeGetArchiveByDate(t *testing.T) {
  8. convey.Convey("GetArchiveByDate", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. aid = "av_id"
  12. table = "av_income"
  13. date = "2018-06-24"
  14. id = int64(0)
  15. limit = int(100)
  16. )
  17. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  18. archives, err := d.GetArchiveByDate(c, aid, table, date, id, limit)
  19. ctx.Convey("Then err should be nil.archives should not be nil.", func(ctx convey.C) {
  20. ctx.So(err, convey.ShouldBeNil)
  21. ctx.So(archives, convey.ShouldNotBeNil)
  22. })
  23. })
  24. })
  25. }
  26. func TestIncomeGetBgmIncomeByDate(t *testing.T) {
  27. convey.Convey("GetBgmIncomeByDate", t, func(ctx convey.C) {
  28. var (
  29. c = context.Background()
  30. date = "2018-06-24"
  31. id = int64(0)
  32. limit = int(100)
  33. )
  34. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  35. archives, err := d.GetBgmIncomeByDate(c, date, id, limit)
  36. ctx.Convey("Then err should be nil.archives should not be nil.", func(ctx convey.C) {
  37. ctx.So(err, convey.ShouldBeNil)
  38. ctx.So(archives, convey.ShouldNotBeNil)
  39. })
  40. })
  41. })
  42. }