StackExchange / StackExchange/StackExchange.Redis

ISubscriber no longer mockable

Open
#969 9 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

⚙️ area:API ➕ enhancement
Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining ISubscriber and the ChannelMessageQueue Subscribe(...) and async overloads mentioned in the issue. Determine how the sealed ChannelMessageQueue prevents mocking, then identify the project’s relevant unit-test coverage; done means code using Redis can substitute or mock ISubscriber for unit tests without breaking the public API.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
backend, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.