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

Add new methods ProxyGenerator.CreateDelegateProxy[WithTarget] #403

Closed
wants to merge 10 commits into from

Commits on Aug 9, 2018

  1. Add ProxyGenerator.CreateDelegateProxy method

    Fortunately for us, @kkozmic already wrote the logic behind this in
    d3ec3bf (in the form of `DelegateProxyGenerator`), so it's mostly a
    matter of creating a more convenient API for it in `ProxyGenerator`.
    stakx committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    cf21193 View commit details
    Browse the repository at this point in the history
  2. Rename DelegateProxyTestCase fixture

    The tests in there are really about `DelegateProxyGenerator`.
    stakx committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    8cf8295 View commit details
    Browse the repository at this point in the history
  3. Add tests for ProxyGenerator.CreateDelegateProxy

    Create a new fixture (having the same name as the one we previously
    renamed) with tests for the new `CreateDelegateProxy` functionality.
    
    The tests targeting `in` parameters are currently failing. We'll need
    to fix this in subsequent commits.
    stakx committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    3b9c10f View commit details
    Browse the repository at this point in the history
  4. Skip failing tests (runtime bug)

    It turns out that the tests from the previous commit fail due to a bug
    in the runtime (`in` parameters + generic types cause `ldtoken` IL to
    reference a non-existent method) that we've previously encountered.
    
    Skip these tests and replace them with similar ones that do not rely
    on a generic delegate type. These will pass just fine.
    stakx committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    b3ffda4 View commit details
    Browse the repository at this point in the history
  5. Add ProxyGenerator.CreateDelegateProxyWithTarget method

    ... and tests verifying that the proxy calls (interceptors and) the
    target as it should.
    stakx committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    f37e736 View commit details
    Browse the repository at this point in the history
  6. Update the changelog

    stakx committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    188c896 View commit details
    Browse the repository at this point in the history
  7. Update the documentation

    stakx committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    f0476ae View commit details
    Browse the repository at this point in the history
  8. Add tests about delegate proxy type caching

    Note that these tests don't opt into the same testing pattern used
    with other proxy kinds; i.e. we don't expand the `ProxyKind` enum be-
    cause the tests using it often wouldn't work for delegate proxies.
    This is because they are more limited than other proxy types and don't
    support most of the usual things like hooks or additional interfaces.
    stakx committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    d75d05b View commit details
    Browse the repository at this point in the history
  9. Add tests for IInvocation.Method & friends

    These tests attempt to document what `IInvocation.Method` and `IInvoc-
    ation.MethodInvocationTarget` should be for the various proxy types.
    
    These tests essentially document two facts:
    
     * `IInvocation.Method` points to the corresponding method in the
       proxied type.
    
     * `IInvocation.MethodInvocationTarget` points to the method that will
       get invoked when invocation proceeds to the target, or `null` if
       there is no target.
    
    No tests are added for `IInvocation.GetConcreteMethod()` and `IInvoc-
    ation.GetConcreteMethodInvocationTarget()`. These deal mostly with
    open generics and don't appear to be relevant for delegate proxies.
    stakx committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    0bd0960 View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2018

  1. Add test for in parameter being unmodifiable

    As requested during the review period for `CreateDelegateProxy`.
    stakx committed Aug 10, 2018
    Configuration menu
    Copy the full SHA
    b3b2ea2 View commit details
    Browse the repository at this point in the history