Ejemplo n.º 1
0
func TestBusShort(t *testing.T) {
	message_list := []eventbus.Message{1, 5, 7, 3, 5, 8, 9, 90, -1, "HAI"}

	eb := eventbus.CreateEventBus()
	h1 := makeReceiver()
	eb.Register(h1.input)
	for _, msg := range message_list {
		eb.Emit(msg)
	}
	eb.Close()

	assert.Equal(t, message_list, <-h1.results, "Handler 1 received items")
}
Ejemplo n.º 2
0
func TestBusEmpty(t *testing.T) {
	eb := eventbus.CreateEventBus()
	eb.Close()
}