feedback_test.go 619 B

123456789101112131415161718192021222324252627
  1. package academy
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/interface/main/creative/model/academy"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestAcademyAddFeedBack(t *testing.T) {
  9. convey.Convey("AddFeedBack", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. f = &academy.FeedBack{}
  13. mid = int64(0)
  14. )
  15. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  16. id, err := d.AddFeedBack(c, f, mid)
  17. ctx.Convey("Then err should be nil.id should not be nil.", func(ctx convey.C) {
  18. ctx.So(err, convey.ShouldBeNil)
  19. ctx.So(id, convey.ShouldNotBeNil)
  20. })
  21. })
  22. })
  23. }