account_test.go 1012 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoAccTags(t *testing.T) {
  9. convey.Convey("AccTags", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. mid = int64(2222)
  13. )
  14. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  15. data, err := d.AccTags(c, mid)
  16. ctx.Convey("Then err should be nil.data should not be nil.", func(ctx convey.C) {
  17. ctx.So(err, convey.ShouldBeNil)
  18. ctx.So(data, convey.ShouldNotBeNil)
  19. })
  20. })
  21. })
  22. }
  23. func TestDaoIsAnswered(t *testing.T) {
  24. convey.Convey("IsAnswered", t, func(ctx convey.C) {
  25. var (
  26. c = context.Background()
  27. mid = int64(2222)
  28. start = time.Now().Unix()
  29. )
  30. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  31. status, err := d.IsAnswered(c, mid, start)
  32. ctx.Convey("Then err should be nil.status should not be nil.", func(ctx convey.C) {
  33. ctx.So(err, convey.ShouldBeNil)
  34. ctx.So(status, convey.ShouldNotBeNil)
  35. })
  36. })
  37. })
  38. }