-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ISubscriber no longer mockable #969
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
Comments
Fair point. I'll think about how we can re-expose this.
…On Mon, 8 Oct 2018, 05:39 BrennanConroy, ***@***.***> wrote:
With the introduction of ChannelMessageQueue Subscribe(...) and the async
version, ISubscriber is no longer mockable (because of sealed class
ChannelMessageQueue) so it's difficult/impossible to unit test code that
uses Redis.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#969>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABDsDcyog3lJwh10qMwSmeJ-K0Mtrspks5uitcagaJpZM4XMPlZ>
.
|
A really awesome way to expose this for testing would be if we could wrap a |
Any update here? We'd like to be able to restore our testing here :). We're happy to help contribute something if it makes sense. My initial design thought is to make it possible by having |
@anurse I'm not 100% sure I follow there - if you were able to PR what you mean, could be an instant win (as long as it's not breaking of course) - have time to by chance? |
Opened PR #1000 (lucky me! do I get a prize?) with a sketch of my idea. I realized it was a little more severe than just a "fix for testability" once I realized that |
Would at least be beneficial to enable unit testing on the channel message handler called by the channel message queue, but this uses the ChannelMessage struct with internal ctor, so not really doable as is. |
Are there any plans to resolve this issue? |
Agreed. Is the problem with extracting an |
FWIW this isn't just about testing. I had wanted to implement an ISubscriber that wraps an inner subscriber using Polly retries, and was stymied by this limitation. |
With the introduction of
ChannelMessageQueue Subscribe(...)
and the async version,ISubscriber
is no longer mockable (because ofsealed class ChannelMessageQueue
) so it's difficult/impossible to unit test code that uses Redis.The text was updated successfully, but these errors were encountered: