jonsequitur / Its.Cqrs

A set of libraries for CQRS and Event Sourcing, with a Domain-Driven Design flavor.
Other
77 stars 21 forks source link

Comment bug or misunderstanding the code - Command{T}.ApplyTo #179

Closed SurajGupta closed 7 years ago

SurajGupta commented 7 years ago

The comment on 69 of Command{T}.cs says: "validate that the command's state is valid in and of itself" https://github.com/jonsequitur/Its.Cqrs/blob/master/Domain/Command%7BT%7D.cs

But I think that the code is also validating the command against the aggregate as well?

ApplyTo calls RunAllValidations which calls ExecuteValidator which I think runs the aggregate validations? Am I reading this incorrectly?

jonsequitur commented 7 years ago

Good call. The comment has gotten separated from the code it described, no doubt by some refactoring or other. If only there were a way to unit test comments. I'll fix it.

SurajGupta commented 7 years ago

:-) thanks!

jonsequitur commented 7 years ago

Fixed by https://github.com/jonsequitur/Its.Cqrs/commit/c2d011ddaeee2fae191493ad097e121daa003753.