business_test.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/manager/model"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestMaxBid(t *testing.T) {
  9. convey.Convey("maxBid", t, func() {
  10. _, err := d.maxBid(context.Background())
  11. convey.So(err, convey.ShouldBeNil)
  12. })
  13. }
  14. func TestUpdateBusiness(t *testing.T) {
  15. convey.Convey("UpdateBusiness", t, func() {
  16. p := &model.Business{
  17. ID: 1,
  18. Name: "test",
  19. Flow: 1,
  20. }
  21. err := d.UpdateBusiness(context.Background(), p)
  22. convey.So(err, convey.ShouldBeNil)
  23. })
  24. }
  25. func TestBusinessChilds(t *testing.T) {
  26. convey.Convey("BusinessChilds", t, func() {
  27. _, err := d.BusinessChilds(context.Background(), 1)
  28. convey.So(err, convey.ShouldBeNil)
  29. })
  30. }
  31. func TestMaxRidByBid(t *testing.T) {
  32. convey.Convey("MaxRidByBid", t, func() {
  33. _, err := d.MaxRidByBid(context.Background(), 1)
  34. convey.So(err, convey.ShouldBeNil)
  35. })
  36. }
  37. func TestParentBusiness(t *testing.T) {
  38. convey.Convey("ParentBusiness", t, func() {
  39. _, err := d.ParentBusiness(context.Background(), int64(1))
  40. convey.So(err, convey.ShouldBeNil)
  41. })
  42. }