coupon_old_test.go 999 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoSalaryLogMaxID(t *testing.T) {
  8. convey.Convey("SalaryLogMaxID", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. dv = "2018_09"
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. maxID, err := d.SalaryLogMaxID(c, dv)
  15. ctx.Convey("Then err should be nil.maxID should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(maxID, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestDaoSelOldSalaryList(t *testing.T) {
  23. convey.Convey("SelOldSalaryList", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. id = int(0)
  27. endID = int(0)
  28. dv = "2018_09"
  29. )
  30. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  31. _, err := d.SelOldSalaryList(c, id, endID, dv)
  32. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  33. ctx.So(err, convey.ShouldBeNil)
  34. })
  35. })
  36. })
  37. }