Release v1.0.0 #2
@ -136,6 +136,17 @@ func Test_UnknownEvent(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func Test_DispatchEventWithError(t *testing.T) {
|
||||
d := NewDispatcher()
|
||||
d.RegisterCommandHandler(testCommand{}, &testCommandHandler{})
|
||||
d.RegisterEventHandler(testEvent{}, &testErrorEventHandler{})
|
||||
|
||||
err := d.DispatchEvent(context.Background(), testEvent{})
|
||||
if err == nil {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Error(t *testing.T) {
|
||||
d := NewDispatcher()
|
||||
d.RegisterCommandHandler(testCommand{}, &testErrorHandler{})
|
||||
|
Loading…
x
Reference in New Issue
Block a user