mirror of
https://github.com/iLoveElysia/openbilibili.git
synced 2026-06-07 21:48:31 -05:00
30 lines
418 B
Go
30 lines
418 B
Go
|
|
package dao
|
||
|
|
|
||
|
|
import (
|
||
|
|
. "github.com/smartystreets/goconvey/convey"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
type testMsg struct {
|
||
|
|
Name string
|
||
|
|
Age int64
|
||
|
|
}
|
||
|
|
|
||
|
|
func TestDao_Pub(t *testing.T) {
|
||
|
|
Convey("pub", t, func() {
|
||
|
|
once.Do(startService)
|
||
|
|
//startSubDataBus()
|
||
|
|
//msgs := subDataBus.Messages()
|
||
|
|
|
||
|
|
var uid int64 = 1
|
||
|
|
u := testMsg{
|
||
|
|
Name: "test",
|
||
|
|
Age: 23,
|
||
|
|
}
|
||
|
|
err := d.Pub(ctx, uid, &u)
|
||
|
|
So(err, ShouldBeNil)
|
||
|
|
t.Logf("pub")
|
||
|
|
|
||
|
|
})
|
||
|
|
}
|