Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
package service
import (
"testing"
"go-common/app/job/main/broadcast/conf"
. "github.com/smartystreets/goconvey/convey"
)
func TestNewService(t *testing.T) {
Convey("TestNewService", t, func() {
s := New(conf.Conf)
So(s, ShouldNotBeNil)
Convey("TestPush", func() {
err := s.pushMsg([]byte("test"))
So(err, ShouldBeNil)
})
Convey("TestPushComet", func() {
s.pushKeys(1, "test", nil, []byte("test"), 0)
})
Convey("TestBroadCast", func() {
s.broadcast(1, []byte("test"), 100, "", 0)
})
Convey("TestBroadCast", func() {
s.broadcastRoomRawBytes("1", []byte("test"))
})
Convey("TestNewRoom", func() {
r := NewRoom(s, "test", RoomOptions{})
So(r, ShouldNotBeNil)
Convey("TestNewPush", func() {
err := r.Push(7, []byte("test"), 0)
So(err, ShouldBeNil)
})
})
})
}