dynamic_test.go 663 B

1234567891011121314151617181920212223242526272829
  1. package notice
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestNoticeDynamic(t *testing.T) {
  8. convey.Convey("Dynamic", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. oid = int64(0)
  12. )
  13. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  14. content, link, err := d.Dynamic(c, oid)
  15. ctx.Convey("Then err should be nil.content,link should not be nil.", func(ctx convey.C) {
  16. if err != nil {
  17. ctx.So(err, convey.ShouldNotBeNil)
  18. } else {
  19. ctx.So(err, convey.ShouldBeNil)
  20. }
  21. ctx.So(link, convey.ShouldNotBeNil)
  22. ctx.So(content, convey.ShouldNotBeNil)
  23. })
  24. })
  25. })
  26. }