mysql_test.go 798 B

123456789101112131415161718192021222324252627282930313233343536
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoCodes(t *testing.T) {
  8. var (
  9. c = context.Background()
  10. )
  11. convey.Convey("Codes", t, func(ctx convey.C) {
  12. codes, lcode, err := d.Codes(c)
  13. ctx.Convey("Then err should be nil.codes,lcode should not be nil.", func(ctx convey.C) {
  14. ctx.So(err, convey.ShouldBeNil)
  15. ctx.So(lcode, convey.ShouldNotBeNil)
  16. ctx.So(codes, convey.ShouldNotBeNil)
  17. })
  18. })
  19. }
  20. func TestDaoDiff(t *testing.T) {
  21. var (
  22. c = context.Background()
  23. ver = int64(0)
  24. )
  25. convey.Convey("Diff", t, func(ctx convey.C) {
  26. vers, err := d.Diff(c, ver)
  27. ctx.Convey("Then err should be nil.vers should not be nil.", func(ctx convey.C) {
  28. ctx.So(err, convey.ShouldBeNil)
  29. ctx.So(vers, convey.ShouldNotBeNil)
  30. })
  31. })
  32. }