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

Await anything & custom awaitable types #1123

Closed
wants to merge 22 commits into from

Commits on Dec 30, 2020

  1. Configuration menu
    Copy the full SHA
    1ca6039 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0792369 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b3b0109 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a8082a4 View commit details
    Browse the repository at this point in the history
  5. Only lift result when necessary

    Some other parts of Moq (e.g. the `ReturnBase` behavior or default
    value providers) already produce awaitables that needn't be lifted.
    stakx committed Dec 30, 2020
    Configuration menu
    Copy the full SHA
    40d0130 View commit details
    Browse the repository at this point in the history
  6. Duplicate tests for ValueTask<>

    stakx committed Dec 30, 2020
    Configuration menu
    Copy the full SHA
    2825207 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b960239 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    cfb3f8f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    84acfdf View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    88c4438 View commit details
    Browse the repository at this point in the history
  11. Add test for Await in Mock.Of

    stakx committed Dec 30, 2020
    Configuration menu
    Copy the full SHA
    ef77bbd View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    a0ffad9 View commit details
    Browse the repository at this point in the history
  13. Enable custom IAwaitHandlers & Await methods

     * `IAwaitableHandler` needs to become public so that it can be
       implemented for user-defined awaitable types.
    
     * `Await` methods for user-defined awaitable types may be defined any-
       where. They are required to be static and have exactly one parameter.
       That parameter gets used to look up a suitable `IAwaitableHandler`.
    
     * Handlers are registered with `AwaitableHandler.Register`. (For this
       reason `AwaitableHandler` is also made public.)
    stakx committed Dec 30, 2020
    Configuration menu
    Copy the full SHA
    2d9a7bb View commit details
    Browse the repository at this point in the history
  14. Create abstract base class AwaitableHandler

    ... by combining the existing `IAwaitableHandler` & `AwaitableHandler`.
    stakx committed Dec 30, 2020
    Configuration menu
    Copy the full SHA
    f2146b2 View commit details
    Browse the repository at this point in the history
  15. Delegate to AwaitableHandlers where appropriate

    This makes both default value providers and "inner mock" discovery
    work seamlessly for all known awaitable types.
    
    Also reduces code duplication a little.
    stakx committed Dec 30, 2020
    Configuration menu
    Copy the full SHA
    058eb0a View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    48270bc View commit details
    Browse the repository at this point in the history
  17. Add tests for SetupSet

    stakx committed Dec 30, 2020
    Configuration menu
    Copy the full SHA
    8a90122 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    35832e6 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    2b7cb48 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    7bd534e View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    8528b9a View commit details
    Browse the repository at this point in the history
  22. Update the changelog

    stakx committed Dec 30, 2020
    Configuration menu
    Copy the full SHA
    c996878 View commit details
    Browse the repository at this point in the history