order_log_test.go 808 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package dao
  2. import (
  3. "context"
  4. "fmt"
  5. "testing"
  6. "go-common/app/service/openplatform/ticket-sales/api/grpc/v1"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestListOrderLogs(t *testing.T) {
  10. Convey("ListOrderLogs", t, func() {
  11. data, err := d.GetOrderLogList(context.TODO(), 12222, 0, 10, "ctime")
  12. if err != nil {
  13. fmt.Println(err)
  14. }
  15. So(err, ShouldBeNil)
  16. So(data, ShouldNotBeNil)
  17. })
  18. }
  19. func TestAddOrderLogs(t *testing.T) {
  20. Convey("AddOrderLogs", t, func() {
  21. oi := &v1.OrderLog{}
  22. oi.UID = "wlt"
  23. oi.OpData = "test"
  24. oi.OID = 12222
  25. oi.OpName = "name"
  26. oi.OpObject = "object"
  27. oi.IP = "127.0.0.1"
  28. oi.Remark = "remark"
  29. data, err := d.AddOrderLog(context.TODO(), oi)
  30. if err != nil {
  31. fmt.Println(err)
  32. }
  33. So(err, ShouldBeNil)
  34. So(data, ShouldNotBeNil)
  35. })
  36. }