Browse Source

chore: fix cqrs tests

extension
wpetit 1 year ago
parent
commit
9343970672
2 changed files with 6 additions and 6 deletions
  1. +3
    -3
      cqrs/bus_test.go
  2. +3
    -3
      cqrs/middleware_test.go

+ 3
- 3
cqrs/bus_test.go View File

@ -10,7 +10,7 @@ type testCommandRequest struct {
}
func TestSimpleCommandExec(t *testing.T) {
bus := NewBus()
dispatcher := NewDispatcher()
handlerCalled := false
@ -19,7 +19,7 @@ func TestSimpleCommandExec(t *testing.T) {
return nil
}
bus.RegisterCommand(
dispatcher.RegisterCommand(
MatchCommandRequest(&testCommandRequest{}),
CommandHandlerFunc(handleTestCommand),
)
@ -29,7 +29,7 @@ func TestSimpleCommandExec(t *testing.T) {
}
ctx := context.Background()
result, err := bus.Exec(ctx, cmd)
result, err := dispatcher.Exec(ctx, cmd)
if err != nil {
t.Error(err)
}


+ 3
- 3
cqrs/middleware_test.go View File

@ -6,7 +6,7 @@ import (
)
func TestBasicCommandMiddleware(t *testing.T) {
bus := NewBus()
dispatcher := NewDispatcher()
handlerCalled := false
@ -26,7 +26,7 @@ func TestBasicCommandMiddleware(t *testing.T) {
return CommandHandlerFunc(fn)
}
bus.RegisterCommand(
dispatcher.RegisterCommand(
MatchCommandRequest(&testCommandRequest{}),
CommandHandlerFunc(handleTestCommand),
commandMiddleware,
@ -37,7 +37,7 @@ func TestBasicCommandMiddleware(t *testing.T) {
}
ctx := context.Background()
result, err := bus.Exec(ctx, cmd)
result, err := dispatcher.Exec(ctx, cmd)
if err != nil {
t.Error(err)
}


Loading…
Cancel
Save