You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the solution you'd like This issue made me wonder....what I could do is ?. when I access the Expectations property within the mock. I'm not thrilled with that idea, as the real issue there is virtual members should not be accessed in constructors. But....the only time the expectations would be null is in the constructor until it's set, so it really shouldn't be called anyway.
Other options would be some way to tell Rocks to not generate mock implementations for indentified virtual members. That's also pretty messy and not very desirable.
One other idea is to do some kind of capture that an expectation was going to happen, but it was null. Then, in the constructor, "run" those expectations. That's potentially a lot of work for very little gain, and again, it's to get around something in code that people shouldn't be doing anyway.
The text was updated successfully, but these errors were encountered:
Describe the solution you'd like
This issue made me wonder....what I could do is
?.
when I access theExpectations
property within the mock. I'm not thrilled with that idea, as the real issue there is virtual members should not be accessed in constructors. But....the only time the expectations would benull
is in the constructor until it's set, so it really shouldn't be called anyway.Other options would be some way to tell Rocks to not generate mock implementations for indentified virtual members. That's also pretty messy and not very desirable.
One other idea is to do some kind of capture that an expectation was going to happen, but it was null. Then, in the constructor, "run" those expectations. That's potentially a lot of work for very little gain, and again, it's to get around something in code that people shouldn't be doing anyway.
The text was updated successfully, but these errors were encountered: