order_test.go 814 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package dao
  2. import (
  3. "testing"
  4. "time"
  5. "go-common/app/admin/ep/melloi/model"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. var (
  9. testOrder = model.Order{
  10. ApplyDate: time.Now(),
  11. ID: 1,
  12. }
  13. pageNum int32 = 1
  14. pageSize int32 = 2
  15. )
  16. func Test_Order(t *testing.T) {
  17. Convey("test QueryOrder", t, func() {
  18. var workOrders *model.QueryOrderResponse
  19. order := model.Order{ID: testOrder.ID}
  20. workOrders, _ = d.QueryOrder(&order, pageNum, pageSize)
  21. So(workOrders, ShouldBeEmpty)
  22. })
  23. Convey("test DeleteOrder", t, func() {
  24. order := model.Order{ID: testOrder.ID}
  25. err := d.DelOrder(order.ID)
  26. So(err, ShouldBeNil)
  27. })
  28. Convey("test UpdateOrder", t, func() {
  29. order := model.Order{ID: testOrder.ID, ApplyDate: testOrder.ApplyDate}
  30. err := d.UpdateOrder(&order)
  31. So(err, ShouldBeNil)
  32. })
  33. }