Skip to content

Question: StackExchange.Redis EventArgs have only internal contructors #1325

@n1l

Description

@n1l

Hi guys, I have a question about event args defined in StackExchange.Redis.
For some reason there are only internal constructors, some classes are sealed and some not, and my question is - why?

I have an idea about the purpose of such internal constructors and sealed classes - basically no one can raise such events except StackExchange.Redis but it would be nice to understand the whole picture from you.

Also I can tell you my motivation to have such possibility. And this is all about unit tests. So imagine I have defined handlers for your events and I have some diagnostic ETW provider which I want to use to check the whole process is working correctly, so I want to mock your events with NSubstitute, but I can't because this events have no public c'tor.

I can do a pr if you don't mind. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions