jointly_test.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package service
  2. import (
  3. "testing"
  4. "go-common/app/admin/main/vip/model"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. // go test -test.v -test.run TestServiceAddJointly
  8. func TestServiceAddJointly(t *testing.T) {
  9. Convey("TestServiceAddJointly", t, func() {
  10. err := s.AddJointly(c, &model.ArgAddJointly{
  11. Title: "这是一条被修改的",
  12. Content: "内容",
  13. StartTime: 1433202904,
  14. EndTime: 1433202905,
  15. Link: "http://www.baidu.com",
  16. IsHot: 1,
  17. Operator: "admin",
  18. })
  19. So(err, ShouldBeNil)
  20. })
  21. }
  22. // go test -test.v -test.run TestServiceModifyJointly
  23. func TestServiceModifyJointly(t *testing.T) {
  24. Convey("TestServiceModifyJointly", t, func() {
  25. err := s.ModifyJointly(c, &model.ArgModifyJointly{
  26. ID: 2,
  27. Title: "无效的记录,修改",
  28. Content: "修改内容",
  29. Link: "http://www.baidu.com",
  30. IsHot: 1,
  31. Operator: "admin",
  32. })
  33. So(err, ShouldBeNil)
  34. })
  35. }
  36. // go test -test.v -test.run TestServiceJointlysByState
  37. func TestServiceJointlysByState(t *testing.T) {
  38. Convey("TestServiceJointlysByState", t, func() {
  39. res, err := s.JointlysByState(c, 2)
  40. t.Logf("count %+v", len(res))
  41. So(err, ShouldBeNil)
  42. })
  43. }