dao_test.go 561 B

123456789101112131415161718192021222324252627282930313233343536
  1. package coin
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "time"
  8. "go-common/app/interface/main/app-view/conf"
  9. . "github.com/smartystreets/goconvey/convey"
  10. )
  11. var (
  12. d *Dao
  13. )
  14. func init() {
  15. dir, _ := filepath.Abs("../../cmd/app-view-test.toml")
  16. flag.Set("conf", dir)
  17. conf.Init()
  18. d = New(conf.Conf)
  19. time.Sleep(time.Second)
  20. }
  21. func ctx() context.Context {
  22. return context.Background()
  23. }
  24. func TestAddCoins(t *testing.T) {
  25. Convey("get AddCoins all", t, func() {
  26. err := d.AddCoins(ctx(), 1, 1, 1, 1, 1, 1, 1, 0)
  27. So(err, ShouldBeNil)
  28. })
  29. }