paramter_test.go 608 B

123456789101112131415161718192021222324
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoGetAllParamter(t *testing.T) {
  8. convey.Convey("GetAllParamter", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. )
  12. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  13. d.db.Exec(c, "INSERT INTO rating_parameter(name,value) VALUES('test', 123)")
  14. paramters, err := d.GetAllParamter(c)
  15. ctx.Convey("Then err should be nil.paramters should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(paramters, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }