bangumi_test.go 708 B

123456789101112131415161718192021222324252627282930
  1. package notice
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestNoticeBangumi(t *testing.T) {
  8. convey.Convey("Bangumi", 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. title, link, epid, err := d.Bangumi(c, oid)
  15. ctx.Convey("Then err should be nil.title,link,epid 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(epid, convey.ShouldNotBeNil)
  22. ctx.So(link, convey.ShouldNotBeNil)
  23. ctx.So(title, convey.ShouldNotBeNil)
  24. })
  25. })
  26. })
  27. }