order_test.go 834 B

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