task_consumer_test.go 1011 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package archive
  2. import (
  3. "context"
  4. . "github.com/smartystreets/goconvey/convey"
  5. "testing"
  6. )
  7. func Test_Consumers(t *testing.T) {
  8. Convey("test archive", t, WithDao(func(d *Dao) {
  9. _, err := d.Consumers(context.Background())
  10. So(err, ShouldBeNil)
  11. }))
  12. }
  13. func Test_IsConsumerOn(t *testing.T) {
  14. Convey("test archive", t, WithDao(func(d *Dao) {
  15. state := d.IsConsumerOn(context.Background(), 1)
  16. So(state, ShouldNotBeNil)
  17. }))
  18. }
  19. func Test_WeightConf(t *testing.T) {
  20. Convey("test archive", t, WithDao(func(d *Dao) {
  21. r, err := d.WeightConf(context.Background())
  22. So(err, ShouldBeNil)
  23. So(r, ShouldNotBeNil)
  24. }))
  25. }
  26. func Test_TaskUserCheckIn(t *testing.T) {
  27. Convey("TaskUserCheckIn", t, WithDao(func(d *Dao) {
  28. _, err := d.TaskUserCheckIn(context.Background(), 0)
  29. So(err, ShouldBeNil)
  30. }))
  31. }
  32. func Test_TaskUserCheckOff(t *testing.T) {
  33. Convey("TaskUserCheckOff", t, WithDao(func(d *Dao) {
  34. r, err := d.TaskUserCheckOff(context.Background(), 0)
  35. So(err, ShouldBeNil)
  36. So(r, ShouldNotBeNil)
  37. }))
  38. }