Skip to content
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

Added overload to enforce old behavior of exact parameter matching #347

Merged
merged 2 commits into from
May 30, 2017

Conversation

80er
Copy link
Contributor

@80er 80er commented May 22, 2017

No description provided.

@80er
Copy link
Contributor Author

80er commented May 23, 2017

Hi,

this is adding an overload in Protected Mock to enable the old behavior of exact parameter type matching again (see also issue #341).

In the tests you can see the scenario in which the new behavior broke existing code. Hope that makes the problem more clear.

@@ -751,6 +771,16 @@ protected virtual string DoReturn(string a, string b)
protected virtual void SameFirstParameter(object a) { }

protected virtual void SameFirstParameter(object a, object b) { }

protected virtual FooBase OverloadWithDerived(MyBase myBase)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kinda confusing that the method is called WithDerived yet it receives a base type. How about naming it simply Overloaded or the like?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your totally right. Updated the method name accordingly. But a better name than "overloaded" also did not come into my mind. Finding good names is harder than coding ;)

@kzu kzu merged commit 3954bfa into devlooped:master May 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants