CQRS Implementation #1

Merged
Rene Nochebuena merged 4 commits from feature/cqrs-implementation into develop 2025-04-13 09:35:48 -06:00
Showing only changes of commit 0c1694c947 - Show all commits

View File

@ -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{})