Skip to content

Commit

Permalink
Merged PR 1366: Bump Moq from 4.15.2 to 4.16.0
Browse files Browse the repository at this point in the history
Bumps [Moq](https://github.com/moq/moq4) from 4.15.2 to 4.16.0.

#Changelog

*Sourced from [Moq's changelog](https://github.com/moq/moq4/blob/main/CHANGELOG.md).*

> ## 4.16.0 (2021-01-16)
>
> #### Added
>
> * Ability to directly set up the `.Result` of tasks and value tasks, which makes setup expressions more uniform by rendering dedicated async verbs like `.ReturnsAsync`, `.ThrowsAsync`, etc. unnecessary:
>
>    ```diff
>    -mock.Setup(x => x.GetFooAsync()).ReturnsAsync(foo)
>    +mock.Setup(x => x.GetFooAsync().Result).Returns(foo)
>    ```
>
>    This is useful in places where there currently aren't any such async verbs at all:
>
>    ```diff
>    -Mock.Of<X>(x => x.GetFooAsync() == Task.FromResult(foo))
>    +Mock.Of<X>(x => x.GetFooAsync().Result == foo)
>    ```
>
>    This also allows recursive setups / method chaining across async calls inside a single setup expression:
>
>    ```diff
>    -mock.Setup(x => x.GetFooAsync()).ReturnsAsync(Mock.Of<IFoo>(f => f.Bar == bar))
>    +mock.Setup(x => x.GetFooAsync().Result.Bar).Returns(bar)
>    ```
>
>    or, with only `Mock.Of`:
>
>    ```diff
>    -Mock.Of<X>(x => x.GetFooAsync() == Task.FromResult(Mock.Of<IFoo>(f => f.Bar == bar)))
>    +Mock.Of<X>(x => x.GetFooAsync().Result.Bar == bar)
>    ```
>
>    This should work in all principal setup methods (`Mock.Of`, `mock.Setup…`, `mock.Verify…`). Support in `mock.Protected()` and for custom awaitable types may be added in the future. (@stakx, [#1126](devlooped/moq#1126))
>
> #### Changed
>
> * Attempts to mark conditionals setup as verifiable are once again allowed; it turns out that forbidding it (as was done in [#997](devlooped/moq#997) for version 4.14.0) is in fact a regression. (@stakx, [#1121](devlooped/moq#1121))
>
> #### Fixed
>
> * Performance regression: Adding setups to a mock becomes slower with each setup (@CeesKaas, [#1110](devlooped/moq#1110))
>
> * Regression: `mock.Verify[All]` no longer marks invocations as verified if they were matched by conditional setups. (@Lyra2108, [#1114](devlooped/moq#1114))

#Commits

- [`74d5863`](devlooped/moq@74d5863) Update version to 4.16.0
- [`424fe31`](devlooped/moq@424fe31) Fix typo in changelog
- [`f48c0f4`](devlooped/moq@f48c0f4) Merge pull request [#1126](devlooped/moq#1126) from stakx/setup-task-result
- [`6f6a89d`](devlooped/moq@6f6a89d) Update the changelog
- [`66bcb21`](devlooped/moq@66bcb21) Enable `task.Result` in delegate-based setup methods
- [`42521c4`](devlooped/moq@42521c4) Add ability in `IAwaitableFactory` to create result...
  • Loading branch information
Maxwell Weru committed Jan 18, 2021
2 parents 018cd82 + b5f0828 commit d21df13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Falu.Tests/Falu.Tests.csproj
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="Moq" Version="4.16.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.analyzers" Version="0.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
Expand Down

0 comments on commit d21df13

Please sign in to comment.