item_test.go 609 B

1234567891011121314151617181920212223242526272829303132
  1. package dao
  2. import (
  3. "context"
  4. . "github.com/smartystreets/goconvey/convey"
  5. "go-common/app/service/openplatform/ticket-item/model"
  6. "sync"
  7. "testing"
  8. )
  9. var (
  10. once sync.Once
  11. d *Dao
  12. ctx = context.TODO()
  13. )
  14. // Test_RawItems
  15. func TestRawItems(t *testing.T) {
  16. Convey("RawItems", t, func() {
  17. once.Do(startService)
  18. res, err := d.RawItems(ctx, model.DataIDs)
  19. So(err, ShouldBeNil)
  20. So(res, ShouldNotBeNil)
  21. So(res, ShouldNotBeEmpty)
  22. })
  23. Convey("RawItems", t, func() {
  24. once.Do(startService)
  25. res, err := d.RawItems(ctx, model.NoDataIDs)
  26. So(err, ShouldNotBeNil)
  27. So(res, ShouldBeEmpty)
  28. })
  29. }