-
-
Notifications
You must be signed in to change notification settings - Fork 812
SetupSet on hierarchy #124
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
Comments
I have the same issue with
Is there a way to set up a complex setter on a mock? |
The above will work just fine as long as the |
@desperate-man:
It appears that you have a misconception about how _viewModelMock.SetupGet(x => x.TestText).Returns("1"); // or just `Setup` will also work See the "Properties" section in the Quickstart guide for some examples how to set up properties. |
Just for the record, in recent versions of Moq, this will produce a more helpful exception:
|
I want to do something like following which is not allowed
It returns
Expression is not a property setter invocation.
When mock.Setup can setup a hierarchy then why is SetupSet limited strictly to direct property assignment? Same applies to SetupGet
The text was updated successfully, but these errors were encountered: