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

Prevent auto-stubbing failure due to inaccessible property accessors #847

Merged
merged 3 commits into from
Jun 6, 2019

Conversation

stakx
Copy link
Contributor

@stakx stakx commented Jun 6, 2019

Fixes #845.

/cc @Mexe13

stakx added 3 commits June 6, 2019 19:04
There are two groups of tests here:

 * Those that test `SetupAllProperties` (called either directly, or
   implicitly through `Mock.Of<T>`) followed by a property acces. This
   reflects `SetupAllProperties`' current implementation, which only
   sets up properties upon their first access (just-in-time).

 * Those that test `SetupAllProperties` itself, without any property
   access. Unsurprisingly, these currently pass, but the tests are
   still good to have in case we ever return `SetupAllProperties` to a
   ahead-of-time batch operation implementation.
@stakx stakx added this to the 4.12.0 milestone Jun 6, 2019
@stakx stakx merged commit b095864 into devlooped:master Jun 6, 2019
@stakx stakx deleted the setupallproperties branch June 6, 2019 17:37
ocoanet pushed a commit to ocoanet/moq4 that referenced this pull request Jun 10, 2019
…evlooped#847)

1. Add regression tests for lazy `SetupAllProperties`

There are two groups of tests here:

 * Those that test `SetupAllProperties` (called either directly, or
   implicitly through `Mock.Of<T>`) followed by a property acces. This
   reflects `SetupAllProperties`' current implementation, which only
   sets up properties upon their first access (just-in-time).

 * Those that test `SetupAllProperties` itself, without any property
   access. Unsurprisingly, these currently pass, but the tests are
   still good to have in case we ever return `SetupAllProperties` to a
   ahead-of-time batch operation implementation.

2. Fix regression by checking accessor visibility

3. Update the changelog
ishimko pushed a commit to ishimko/moq4 that referenced this pull request Sep 2, 2019
…evlooped#847)

1. Add regression tests for lazy `SetupAllProperties`

There are two groups of tests here:

 * Those that test `SetupAllProperties` (called either directly, or
   implicitly through `Mock.Of<T>`) followed by a property acces. This
   reflects `SetupAllProperties`' current implementation, which only
   sets up properties upon their first access (just-in-time).

 * Those that test `SetupAllProperties` itself, without any property
   access. Unsurprisingly, these currently pass, but the tests are
   still good to have in case we ever return `SetupAllProperties` to a
   ahead-of-time batch operation implementation.

2. Fix regression by checking accessor visibility

3. Update the changelog
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.

Breaking Change Moq 4.11 - SetupAllProperties() (includes Mock.Of<T>) fails in cases it didn't before
1 participant