Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: devlooped/moq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.14.6
Choose a base ref
...
head repository: devlooped/moq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.14.7
Choose a head ref
  • 17 commits
  • 9 files changed
  • 1 contributor

Commits on Oct 14, 2020

  1. Add failing test re: VB.NET Convert nodes

    It appears that VB.NET adds a pair of `Convert` nodes to expression
    trees for constrained generic type parameters. Those double conversions
    can end up "hiding" matchers thus wrapped from Moq's `MatcherFactory`.
    stakx committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    3134e1c View commit details
    Browse the repository at this point in the history
  2. Unwrap double (and triple, etc.) conversions

    The existing code in `MatcherFactory` unwraps only one conversion node
    to get at matchers etc. This is not enough in the scenario documented
    in the previous commit's failing test, which causes two conversion nodes
    to be present.
    
    This bug fix assumes that any conversion nodes present are only there
    to satisfy the compiler's static type checks, but that they are irrele-
    vant (and can thus be removed) for any analysis that needs to be done
    to identify a suitable matcher.
    
    (It might be safer to not simply remove any conversion node blindly,
    but instead target this very specific VB.NET pattern and deal with it
    as a special case.)
    stakx committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    eac0323 View commit details
    Browse the repository at this point in the history
  3. Update the changelog

    stakx committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    b0346de View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d3128ef View commit details
    Browse the repository at this point in the history
  5. Add failing test caused by regression in cb6b71a

    Since that commit, inner mocks created by `Mock.Of<>()` no longer have
    their properties stubbed. `SetupAllProperties` is now only called for
    the root (outermost) mock. That's why nested properties can no longer
    be overridden simply by assigning to them.
    stakx committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    3f54557 View commit details
    Browse the repository at this point in the history
  6. Make DefaultValue.Mock inherit property stubbing

    The XML doc comment for `Mock<T>.SetupAllProperties()` states that:
    
    > If the mock's `DefaultValue` is set to `DefaultValue.Mock`, the
    > mocked default values will also get all properties setup recursively.
    
    But this does not actually happen! This commit changes the behavior of
    `DefaultValue.Mock` such that it does what it says on the tin.
    
    In theory, this could be a breaking change; let's see how many users
    have relied on behavior that contradicts the documentation.
    
    References:
    https://github.com/moq/moq4/blob/947c6a0aa1bbf265b5555ad0a84beb5bfc53b4e2/src/Moq/Mock.Generic.cs#L671-L674
    stakx committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    447e38a View commit details
    Browse the repository at this point in the history
  7. Update the changelog

    stakx committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    2363e09 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ab83afc View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    42c0083 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    b9e733b View commit details
    Browse the repository at this point in the history
  11. Update the changelog

    stakx committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    cd9a3c2 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    3b537f6 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    69c0223 View commit details
    Browse the repository at this point in the history
  14. More precise check for anonymous types

    ...since not all compiler-generated types are anonymous types.
    stakx committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    9a936b9 View commit details
    Browse the repository at this point in the history
  15. Update the changelog

    stakx committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    4d7d3c7 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    05f1d5f View commit details
    Browse the repository at this point in the history
  17. Update version to 4.14.7

    stakx committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    02f14d5 View commit details
    Browse the repository at this point in the history
Loading