-
Notifications
You must be signed in to change notification settings - Fork 151
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
Adjustments to interfaces to improve the mockability and faking of NATS for unit testing in consumer apps. #654
Conversation
…TS for unit testing in consumer apps.
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 like this idea but we cannot change the interface in a non backward compatible way.
@scottf I removed the IConnection changes, but found that protecting the Message in the handler makes mocking the handling of the message impossible. I adjusted the Handler to expose the message to being set. |
@sspates-starbucks I'm good with the event message changes, not excited about having a public setter, but I suppose it's benign, the worst that could happen is the dev overwrites their own message. |
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.
LGTM
Updated a few interfaces to use IConnection instead of Connection as Connection is internal. This is preventing mocking libraries from being able to mock properly.
Added interface for ConnectionFactory so factory can be mocked/faked in unit tests.