-
Notifications
You must be signed in to change notification settings - Fork 20
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
Don't Force Expectations To Be Set For Members That Have Implementations #163
Comments
I can do this with a base class, but not a base interface with DIM. I need this feature to make its way into C# for Rocks to be able to call the "base" implementation. |
So, it looks like a type that wraps + delegates for non-DIMs and not implement the DIMs would work. However, that's also a fair amount of code I'd have to generate, so....I'm really not keen on doing that right now. I think what I'll do is create another issue that says "we should allow base DIM calls" and then state that either we wait for the compiler+runtime support, or do this approach. At least now we won't be forcing users to implement expectations for virtual calls on base class members. |
I changed my mind :). I think I'm going to put this shim code in now. |
Giving credit where credit is due .... this is the thread post that suggested the wrapping/forwarding idea. |
So the idea is this. As I'm finding mockable members in
The shim class is a |
Consider the following interface:
If I do this:
I get an
ExpectedException
.If I change this to a class:
Then, if I do this:
I still get an exception.
My point is, if a virtual member has an implementation, I shouldn't fail if an expectation is not in place. I can still create an expectation for it, but if it doesn't exist, just fall back to the implementation that is in place.
The text was updated successfully, but these errors were encountered: