You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
410 B
Go
24 lines
410 B
Go
package util
|
|
|
|
import (
|
|
"github.com/matryer/is"
|
|
"testing"
|
|
)
|
|
|
|
func (eb *EventBus) Handled(e Event) bool {
|
|
// TODO: figure out how to verify the event signature here.
|
|
handlers, exists := eb.handlers[e.EventName()]
|
|
if !exists {
|
|
return false
|
|
}
|
|
|
|
return len(handlers) > 0
|
|
}
|
|
|
|
func AcceptsMessage(t *testing.T, eb *EventBus, es []Event) {
|
|
is := is.New(t)
|
|
for _, e := range es {
|
|
is.True(eb.Handled(e))
|
|
}
|
|
}
|