dao.cache_test.go 619 B

1234567891011121314151617181920212223242526
  1. package notice
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestRoomNoticeMonthConsume(t *testing.T) {
  8. convey.Convey("MonthConsume", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. id = int64(10000)
  12. targetID = int64(1008)
  13. date = "20190101"
  14. )
  15. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  16. res, err := d.MonthConsume(c, id, targetID, date)
  17. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  18. ctx.So(err, convey.ShouldBeNil)
  19. ctx.So(res, convey.ShouldNotBeNil)
  20. })
  21. })
  22. })
  23. }