🎛 Event-Catcher with variety of advanced Actions to service projects, libraries, build processes, runtime environment of the Visual Studio, MSBuild Tools, and …
Changelog
*Sourced from [Moq's changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md).*
> ## 4.13.0 (2019-08-31)
>
> #### Changed
>
> * Improved error message that is supplied with `ArgumentException` thrown when `Setup` or `Verify` are called on a protected method if the method could not be found with both the name and compatible argument types specified ([@thomasfdm](https://github.com/thomasfdm), [#852](https://github-redirect.dependabot.com/moq/moq4/issues/852)).
>
> * `mock.Invocations.Clear()` now removes traces of previous invocations more thoroughly by additionally resetting all setups to an "unmatched" state. ([@stakx](https://github.com/stakx), [#854](https://github-redirect.dependabot.com/moq/moq4/issues/854))
>
> * Consistent `Callback` delegate validation regardless of whether or not `Callback` is preceded by a `Returns`: Validation for post-`Returns` callback delegates used to be very relaxed, but is now equally strict as in the pre-`Returns` case.) ([@stakx](https://github.com/stakx), [#876](https://github-redirect.dependabot.com/moq/moq4/issues/876))
>
> * Subscription to mocked events used to be handled less strictly than subscription to regular CLI events. As with the latter, subscribing to mocked events now also requires all handlers to have the same delegate type. ([@stakx](https://github.com/stakx), [#891](https://github-redirect.dependabot.com/moq/moq4/issues/891))
>
> * Moq will throw when it detects that an argument matcher will never match anything due to the presence of an implicit conversion operator. ([@michelcedric](https://github.com/michelcedric), [#897](https://github-redirect.dependabot.com/moq/moq4/issues/897), [#898](https://github-redirect.dependabot.com/moq/moq4/issues/898))
>
> * New algorithm for matching invoked methods against methods specified in setup/verification expressions. ([@stakx](https://github.com/stakx), [#904](https://github-redirect.dependabot.com/moq/moq4/issues/904))
>
> #### Added
>
> * Added support for setup and verification of the event handlers through `Setup[Add|Remove]` and `Verify[Add|Remove|All]` ([@lepijohnny](https://github.com/lepijohnny), [#825](https://github-redirect.dependabot.com/moq/moq4/issues/825))
>
> * Added support for lambda expressions while creating a mock through `new Mock(() => new SomeType("a", "b"))` and `repository.Create(() => new SomeType("a", "b"))`. This makes the process of mocking a class without a parameterless constructor simpler (compiler syntax checker...). ([@frblondin](https://github.com/frblondin), [#884](https://github-redirect.dependabot.com/moq/moq4/issues/884))
>
> * Support for matching generic type arguments: `mock.Setup(m => m.Method(...))`. ([@stakx](https://github.com/stakx), [#908](https://github-redirect.dependabot.com/moq/moq4/issues/908))
>
> The standard type matchers are:
>
> - `It.IsAnyType` — matches any type
> - `It.IsSubtype` — matches `T` and proper subtypes of `T`
> - `It.IsValueType` — matches only value types
>
> You can create your own custom type matchers:
>
> ```csharp
> [TypeMatcher]
> class Either : ITypeMatcher
> {
> public bool Matches(Type type) => type == typeof(A) || type == typeof(B);
> }
> ```
>
> * In order to support type matchers (see bullet point above), some new overloads have been added to existing methods:
>
> - `setup.Callback(new InvocationAction(invocation => ...))`,
> `setup.Returns(new InvocationFunc(invocation => ...))`:
>
> The lambda specified in these new overloads will receive an `IInvocation` representing the current invocation from which type arguments as well as arguments can be discovered.
>
> - `Match.Create((object argument, Type parameterType) => ..., ...)`,
> `It.Is((object argument, Type parameterType) => ...)`:
>
> ... (truncated)
Commits
- [`a12fe5b`](https://github.com/moq/moq4/commit/a12fe5b1fc2eb7857799d5a7bb5cc9e18f61aace) Update version to 4.13.0
- [`fff9464`](https://github.com/moq/moq4/commit/fff94648e83b60291410f3ae1c462a5c7e9d2d86) Retire `.xdoc` XML documentation files ([#916](https://github-redirect.dependabot.com/moq/moq4/issues/916))
- [`3024c61`](https://github.com/moq/moq4/commit/3024c61ce0ce92b2eda4fc85e1593678de59adce) Merge pull request [#915](https://github-redirect.dependabot.com/moq/moq4/issues/915) from stakx/returnsasync-null
- [`50b5d0a`](https://github.com/moq/moq4/commit/50b5d0a48b630b00b3199c234420b8fcdd70115e) Update the changelog
- [`6f8edce`](https://github.com/moq/moq4/commit/6f8edceebde3d33796431251da4e9ce452a75d70) Add special handling for `.ReturnsAsync(null)`
- [`030f000`](https://github.com/moq/moq4/commit/030f000ef23b15296730ad1d57e894e07512af24) `.ReturnsAsync(null)`: should interpret as value, not lambda
- [`bf45f80`](https://github.com/moq/moq4/commit/bf45f802dad2309f34b6aa4461d8598668e46daf) Merge pull request [#914](https://github-redirect.dependabot.com/moq/moq4/issues/914) from stakx/events
- [`429e870`](https://github.com/moq/moq4/commit/429e87066671806d4127f4a932ad9d5c9a3362db) Update the changelog
- [`3117d53`](https://github.com/moq/moq4/commit/3117d53774d6da113606b903083eb5f7ae360b0b) Add more tests re: event method resolution
- [`645c034`](https://github.com/moq/moq4/commit/645c034b1ddac59c93ae40f4f0a7740f7973abe5) Represent events not by name only, but by their `EventInfo`
- Additional commits viewable in [compare view](https://github.com/moq/moq4/compare/v4.12.0...v4.13.0)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Note: This repo was added to Dependabot recently, so you'll receive a maximum of 4 PRs for your first few update runs. Once an update run creates fewer than 4 PRs we'll remove that limit.
You can always request more updates by clicking Bump now in your Dependabot dashboard.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in the `.dependabot/config.yml` file in this repo:
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Finally, you can contact us by mentioning @dependabot.
Bumps Moq from 4.12.0 to 4.13.0.
Changelog
*Sourced from [Moq's changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md).* > ## 4.13.0 (2019-08-31) > > #### Changed > > * Improved error message that is supplied with `ArgumentException` thrown when `Setup` or `Verify` are called on a protected method if the method could not be found with both the name and compatible argument types specified ([@thomasfdm](https://github.com/thomasfdm), [#852](https://github-redirect.dependabot.com/moq/moq4/issues/852)). > > * `mock.Invocations.Clear()` now removes traces of previous invocations more thoroughly by additionally resetting all setups to an "unmatched" state. ([@stakx](https://github.com/stakx), [#854](https://github-redirect.dependabot.com/moq/moq4/issues/854)) > > * Consistent `Callback` delegate validation regardless of whether or not `Callback` is preceded by a `Returns`: Validation for post-`Returns` callback delegates used to be very relaxed, but is now equally strict as in the pre-`Returns` case.) ([@stakx](https://github.com/stakx), [#876](https://github-redirect.dependabot.com/moq/moq4/issues/876)) > > * Subscription to mocked events used to be handled less strictly than subscription to regular CLI events. As with the latter, subscribing to mocked events now also requires all handlers to have the same delegate type. ([@stakx](https://github.com/stakx), [#891](https://github-redirect.dependabot.com/moq/moq4/issues/891)) > > * Moq will throw when it detects that an argument matcher will never match anything due to the presence of an implicit conversion operator. ([@michelcedric](https://github.com/michelcedric), [#897](https://github-redirect.dependabot.com/moq/moq4/issues/897), [#898](https://github-redirect.dependabot.com/moq/moq4/issues/898)) > > * New algorithm for matching invoked methods against methods specified in setup/verification expressions. ([@stakx](https://github.com/stakx), [#904](https://github-redirect.dependabot.com/moq/moq4/issues/904)) > > #### Added > > * Added support for setup and verification of the event handlers through `Setup[Add|Remove]` and `Verify[Add|Remove|All]` ([@lepijohnny](https://github.com/lepijohnny), [#825](https://github-redirect.dependabot.com/moq/moq4/issues/825)) > > * Added support for lambda expressions while creating a mock through `new MockCommits
- [`a12fe5b`](https://github.com/moq/moq4/commit/a12fe5b1fc2eb7857799d5a7bb5cc9e18f61aace) Update version to 4.13.0 - [`fff9464`](https://github.com/moq/moq4/commit/fff94648e83b60291410f3ae1c462a5c7e9d2d86) Retire `.xdoc` XML documentation files ([#916](https://github-redirect.dependabot.com/moq/moq4/issues/916)) - [`3024c61`](https://github.com/moq/moq4/commit/3024c61ce0ce92b2eda4fc85e1593678de59adce) Merge pull request [#915](https://github-redirect.dependabot.com/moq/moq4/issues/915) from stakx/returnsasync-null - [`50b5d0a`](https://github.com/moq/moq4/commit/50b5d0a48b630b00b3199c234420b8fcdd70115e) Update the changelog - [`6f8edce`](https://github.com/moq/moq4/commit/6f8edceebde3d33796431251da4e9ce452a75d70) Add special handling for `.ReturnsAsync(null)` - [`030f000`](https://github.com/moq/moq4/commit/030f000ef23b15296730ad1d57e894e07512af24) `.ReturnsAsync(null)`: should interpret as value, not lambda - [`bf45f80`](https://github.com/moq/moq4/commit/bf45f802dad2309f34b6aa4461d8598668e46daf) Merge pull request [#914](https://github-redirect.dependabot.com/moq/moq4/issues/914) from stakx/events - [`429e870`](https://github.com/moq/moq4/commit/429e87066671806d4127f4a932ad9d5c9a3362db) Update the changelog - [`3117d53`](https://github.com/moq/moq4/commit/3117d53774d6da113606b903083eb5f7ae360b0b) Add more tests re: event method resolution - [`645c034`](https://github.com/moq/moq4/commit/645c034b1ddac59c93ae40f4f0a7740f7973abe5) Represent events not by name only, but by their `EventInfo` - Additional commits viewable in [compare view](https://github.com/moq/moq4/compare/v4.12.0...v4.13.0)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Note: This repo was added to Dependabot recently, so you'll receive a maximum of 4 PRs for your first few update runs. Once an update run creates fewer than 4 PRs we'll remove that limit.
You can always request more updates by clicking
Bump now
in your Dependabot dashboard.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in the `.dependabot/config.yml` file in this repo: - Update frequency (including time of day and day of week) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) Finally, you can contact us by mentioning @dependabot.