official-stream_test.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoGetOfficialStreamByName(t *testing.T) {
  8. convey.Convey("GetOfficialStreamByName", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. name = "live_19148701_6447624"
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. infos, err := d.GetOfficialStreamByName(c, name)
  15. ctx.Convey("Then err should be nil.infos should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(infos, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestDaoGetOfficialStreamByRoomID(t *testing.T) {
  23. convey.Convey("GetOfficialStreamByRoomID", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. rid = int64(11891462)
  27. )
  28. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  29. infos, err := d.GetOfficialStreamByRoomID(c, rid)
  30. ctx.Convey("Then err should be nil.infos should not be nil.", func(ctx convey.C) {
  31. ctx.So(err, convey.ShouldBeNil)
  32. ctx.So(infos, convey.ShouldNotBeNil)
  33. })
  34. })
  35. })
  36. }