drawyoo_test.go 657 B

1234567891011121314151617181920212223242526272829
  1. package notice
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestNoticeDrawyoo(t *testing.T) {
  8. convey.Convey("Drawyoo", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. hid = int64(0)
  12. )
  13. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  14. title, link, err := d.Drawyoo(c, hid)
  15. ctx.Convey("Then err should be nil.title,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(title, convey.ShouldNotBeNil)
  23. })
  24. })
  25. })
  26. }