-
Notifications
You must be signed in to change notification settings - Fork 563
command serializer to output camlCase as events #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
command serializer to output camlCase as events #415
Conversation
| { | ||
| public class StreamKernelCommand | ||
| { | ||
| [JsonProperty("id")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need both this and the CamelCasePropertyNamesContractResolver?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the contract resolver is to force the properties of nested objects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, but then why are the attributes needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to have them if the y get serialized outside of the api. Ideally i'd stick them on the domain commands and events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that happens then the contract on the nested objects would be broken anyway.
For this reason I often make serialization-specific wrapper classes internal. The serialized output is the contract, and the class is an implementation detail that isn't intended to be used for other purposes.
| var kernel = new CompositeKernel() | ||
| { | ||
| new CSharpKernel(), | ||
| new FakeKernel("fake") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the FakeKernel needed for this test?
|
|
||
| events.Should() | ||
| .NotContain(e => e.EventType == nameof(CommandNotRecognized)); | ||
| this.Assent(text, _configuration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be overly strict. Assent should be used for tests that are explicitly contract tests. This was (until now, and in terms of naming) a test of functionality. We should separate these so test failures are more informative and functional tests are resilient to normal refactoring.
serialized kernel command are serialized with camlCase convention