sewenew / redis-plus-plus

Redis client written in C++
Apache License 2.0
1.64k stars 351 forks source link

[QUESTION] QueuedReplies Constructor #351

Closed mellis13 closed 2 years ago

mellis13 commented 2 years ago

Hello,

I am using redis-plus-plus in an application, and I want to write some unit tests for functionality written around the QueuedReplies return type.

To mimic pipeline execution, I was planning to build a std::vector<ReplyUPtr> replies and construct a QueuedReplies object. However, aside from the default constructor and move constructor, there isn't a public constructor available for QueuedReplies.

Would the developers of redis-plus-plus be open to making explicit QueuedReplies(std::vector<ReplyUPtr> replies) public so that downstream applications can create unit tests without executing pipelines.

sewenew commented 2 years ago

IMHO, this is an internal implementation detail, we should not expose to end user.

In your case, how about having a Redis mock? Also an alternative, but nasty way, is the #define public private trick.

Regards

sewenew commented 2 years ago

Since there's no update, I'll close this issue.

Regards