rating_test.go 977 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoTaskStatus(t *testing.T) {
  8. convey.Convey("TaskStatus", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. date = "2018-11-01"
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. status, err := d.TaskStatus(c, date)
  15. ctx.Convey("Then err should be nil.status should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(status, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestDaoUpScore(t *testing.T) {
  23. convey.Convey("UpScore", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. mon = int(11)
  27. mid = int64(1)
  28. date = "2018-11-01"
  29. )
  30. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  31. _, err := d.UpScore(c, mon, mid, date)
  32. ctx.Convey("Then err should be nil.score should not be nil.", func(ctx convey.C) {
  33. ctx.So(err, convey.ShouldBeNil)
  34. })
  35. })
  36. })
  37. }