Skip to content

Commit

Permalink
Check disable state in IsHandlerEqual().
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Jul 16, 2024
1 parent 9123284 commit 4ccb405
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func IsHandlerEqual(a, b Handler) bool {
return a.Identity() == b.Identity() &&
a.TypeName() == b.TypeName() &&
a.HandlerType() == b.HandlerType() &&
a.IsDisabled() == b.IsDisabled() &&
a.MessageNames().IsEqual(b.MessageNames())
}

Expand Down
14 changes: 14 additions & 0 deletions handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,20 @@ var _ = Describe("func IsHandlerEqual()", func() {
},
}),
),
Entry(
"disabled state differs",
FromAggregate(&fixtures.AggregateMessageHandler{
ConfigureFunc: func(c dogma.AggregateConfigurer) {
c.Identity("<name>", aggregateKey)
c.Routes(
dogma.HandlesCommand[fixtures.MessageA](),
dogma.HandlesCommand[fixtures.MessageB](),
dogma.RecordsEvent[fixtures.MessageE](),
)
c.Disable()
},
}),
),
Entry(
"messages differ",
FromAggregate(&fixtures.AggregateMessageHandler{
Expand Down

0 comments on commit 4ccb405

Please sign in to comment.