up_base_info_test.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package upcrm
  2. import (
  3. "testing"
  4. "github.com/jinzhu/gorm"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestUpcrmQueryUpBaseInfo(t *testing.T) {
  8. convey.Convey("QueryUpBaseInfo", t, func(ctx convey.C) {
  9. var (
  10. mid = int64(0)
  11. fields = "*"
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. result, err := d.QueryUpBaseInfo(mid, fields)
  15. ctx.Convey("Then err should be nil.result should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldEqual, gorm.ErrRecordNotFound)
  17. ctx.So(result, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestUpcrmQueryUpBaseInfoBatchByMid(t *testing.T) {
  23. convey.Convey("QueryUpBaseInfoBatchByMid", t, func(ctx convey.C) {
  24. var (
  25. fields = "*"
  26. mid = int64(0)
  27. )
  28. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  29. result, err := d.QueryUpBaseInfoBatchByMid(fields, mid)
  30. ctx.Convey("Then err should be nil.result should not be nil.", func(ctx convey.C) {
  31. ctx.So(err, convey.ShouldBeNil)
  32. ctx.So(result, convey.ShouldNotBeNil)
  33. })
  34. })
  35. })
  36. }
  37. func TestUpcrmQueryUpBaseInfoBatchByID(t *testing.T) {
  38. convey.Convey("QueryUpBaseInfoBatchByID", t, func(ctx convey.C) {
  39. var (
  40. fields = "*"
  41. id = int64(0)
  42. )
  43. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  44. result, err := d.QueryUpBaseInfoBatchByID(fields, id)
  45. ctx.Convey("Then err should be nil.result should not be nil.", func(ctx convey.C) {
  46. ctx.So(err, convey.ShouldBeNil)
  47. ctx.So(result, convey.ShouldNotBeNil)
  48. })
  49. })
  50. })
  51. }