api_test.go 1007 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package dao
  2. import (
  3. "go-common/app/service/live/xuser/conf"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoNew(t *testing.T) {
  8. convey.Convey("New", t, func(ctx convey.C) {
  9. var (
  10. c = &conf.Config{}
  11. )
  12. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  13. dao := New(c)
  14. ctx.Convey("Then dao should not be nil.", func(ctx convey.C) {
  15. ctx.So(dao, convey.ShouldNotBeNil)
  16. })
  17. })
  18. })
  19. }
  20. func TestDaoInitAPI(t *testing.T) {
  21. convey.Convey("InitAPI", t, func(ctx convey.C) {
  22. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  23. InitAPI()
  24. ctx.Convey("No return values", func(ctx convey.C) {
  25. })
  26. })
  27. })
  28. }
  29. func TestDaogetConf(t *testing.T) {
  30. convey.Convey("getConf", t, func(ctx convey.C) {
  31. var (
  32. appName = ""
  33. )
  34. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  35. p1 := getConf(appName)
  36. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  37. ctx.So(p1, convey.ShouldNotBeNil)
  38. })
  39. })
  40. })
  41. }