-
-
Notifications
You must be signed in to change notification settings - Fork 794
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
Recursive property setup overrides previous setups #110
Comments
For completeness the interfaces are defined as: public interface Foo
{
Bar Bar { get; }
}
public interface Bar
{
Baz Baz { get; }
Qux Qux { get; }
}
public interface Qux
{
string Value { get; }
}
public interface Baz
{
string Value { get; }
} |
Seems like a valid use case and a bug :( |
It gets awkward when you replace bar with
If the recursive syntax ends on a mock it should still work. I've solved my issue by writing a method that takes a Do you want me to have a look at fixing this? |
Would love it if you could give it a shot! Thanks /kzu On Thu, May 15, 2014 at 3:27 PM, James Foster notifications@github.comwrote:
|
Cool. I'll check it out. I came across the relevant areas of the code when making my last pull request. Shouldn't be too difficult. (He says) |
Closing this, this problem will be tracked in #643 (together with a couple other related issues). |
After the recent merges, this might finally be fairly easy to fix. |
Apologies for the cryptic subject. It's difficult to explain this without an example.
Here's a failing test:
Effectively I've set up the return value of
Foo.Bar
,Bar.Qux
andQux.Value
separately and then used the call theSetupGet
to override the value ofFoo.Bar.Baz.Value
. This replaces the previously setupFoo.Bar
with a new mock without the registration ofBar.Qux
.Not sure whether this is an edge case you want to support but I'm not sure of the best way to work around it. Any help would be greatly appreciated
The text was updated successfully, but these errors were encountered: