示例#1
0
文件: bus_test.go 项目: pajato/bus
func TestRunHandlersWithNoData(t *testing.T) {
	b := New()
	name := "testEvent"
	b.AddHandlers(name, h1, h2, h3, h4)
	e := event.New(name)
	b.Post(e)
}
示例#2
0
文件: bus_test.go 项目: pajato/bus
func TestRunSynchHandlersWithData(t *testing.T) {
	b := New()
	name := "testEventSync"
	b.AddHandlers(name, handler)
	e := event.New(name)
	e.Data()["count"] = 23
	if err := b.PostAndWait(e); err != nil {
		t.Errorf("The post failed with message: %v.\n", err)
	}
}