Skip to content

Commit 2c4de55

Browse files
committed
refactor: migrate to awesomeassertions and xunitv3
1 parent 7d4e09c commit 2c4de55

17 files changed

+650
-738
lines changed

Directory.Packages.props

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,16 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageVersion Include="coverlet.collector" Version="6.0.2">
7-
<PrivateAssets>all</PrivateAssets>
8-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
9-
</PackageVersion>
10-
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.25">
11-
<PrivateAssets>all</PrivateAssets>
12-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13-
</PackageVersion>
14-
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
15-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
6+
<PackageVersion Include="AwesomeAssertions" Version="9.3.0" />
7+
<PackageVersion Include="AwesomeAssertions.Analyzers" Version="9.0.8" />
8+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
9+
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.39" />
10+
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.1" />
11+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
1612
<PackageVersion Include="Moq" Version="4.20.72" />
17-
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
18-
<PrivateAssets>all</PrivateAssets>
19-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20-
</PackageVersion>
21-
<PackageVersion Include="xunit" Version="2.9.2" />
22-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0">
23-
<PrivateAssets>all</PrivateAssets>
24-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25-
</PackageVersion>
13+
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
14+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
15+
<PackageVersion Include="xunit.v3.mtp-off" Version="3.2.1" />
2616
</ItemGroup>
2717
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
2818
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="[8,9)" />
@@ -39,4 +29,4 @@
3929
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="[10,11)" />
4030
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="[10,11)" />
4131
</ItemGroup>
42-
</Project>
32+
</Project>

src/ExpressionCache.Core.Tests/CacheKeyBuilderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Globalization;
4+
using AwesomeAssertions;
45
using ExpressionCache.Core.Tests.Data;
5-
using FluentAssertions;
66
using Xunit;
77

88
namespace ExpressionCache.Core.Tests;

src/ExpressionCache.Core.Tests/CacheResultTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using FluentAssertions;
1+
using AwesomeAssertions;
22
using Xunit;
33

44
namespace ExpressionCache.Core.Tests;

src/ExpressionCache.Core.Tests/Data/CacheableObject.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
namespace ExpressionCache.Core.Tests.Data;
22

3-
public class CacheableObject : ICacheKey
3+
public class CacheableObject(int parameter1, string parameter2) : ICacheKey
44
{
5-
public CacheableObject(int parameter1, string parameter2)
6-
{
7-
Parameter1 = parameter1;
8-
Parameter2 = parameter2;
9-
}
10-
11-
public int Parameter1 { get; set; }
5+
public int Parameter1 { get; set; } = parameter1;
126

13-
public string Parameter2 { get; set; }
7+
public string Parameter2 { get; set; } = parameter2;
148

159
public void BuildCacheKey(ICacheKeyBuilder builder)
1610
{

src/ExpressionCache.Core.Tests/Data/ExpressionCacheBaseWrapper.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,5 @@
22

33
namespace ExpressionCache.Core.Tests.Data;
44

5-
public class ExpressionCacheBaseWrapper : ExpressionCacheBase
6-
{
7-
public ExpressionCacheBaseWrapper(IMemoryCache internalCache, IExpressionCacheProvider provider)
8-
: base(internalCache, provider)
9-
{
10-
}
11-
}
5+
public class ExpressionCacheBaseWrapper(IMemoryCache internalCache, IExpressionCacheProvider provider)
6+
: ExpressionCacheBase(internalCache, provider);

src/ExpressionCache.Core.Tests/Data/MemoryCacheWrapper.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,5 @@
33

44
namespace ExpressionCache.Core.Tests.Data;
55

6-
public class MemoryCacheWrapper : MemoryCache
7-
{
8-
public MemoryCacheWrapper(IOptions<MemoryCacheOptions> optionsAccessor)
9-
: base(optionsAccessor)
10-
{
11-
}
12-
}
6+
public class MemoryCacheWrapper(IOptions<MemoryCacheOptions> optionsAccessor)
7+
: MemoryCache(optionsAccessor);

src/ExpressionCache.Core.Tests/ExpressionCache.Core.Tests.csproj

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
45
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
56
<IsPackable>false</IsPackable>
67
</PropertyGroup>
78

89
<ItemGroup>
10+
<PackageReference Include="AwesomeAssertions" />
11+
<PackageReference Include="AwesomeAssertions.Analyzers">
12+
<PrivateAssets>all</PrivateAssets>
13+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
14+
</PackageReference>
915
<PackageReference Include="coverlet.collector">
1016
<PrivateAssets>all</PrivateAssets>
1117
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1218
</PackageReference>
13-
<PackageReference Include="FluentAssertions" />
19+
<PackageReference Include="GitHubActionsTestLogger">
20+
<PrivateAssets>all</PrivateAssets>
21+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22+
</PackageReference>
1423
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1524
<PackageReference Include="Moq" />
16-
<PackageReference Include="xunit" />
1725
<PackageReference Include="xunit.runner.visualstudio">
1826
<PrivateAssets>all</PrivateAssets>
1927
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2028
</PackageReference>
29+
<PackageReference Include="xunit.v3.mtp-off" />
2130
</ItemGroup>
2231

2332
<ItemGroup>

src/ExpressionCache.Core.Tests/ExpressionCacheBaseTests.cs

Lines changed: 41 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
using System;
22
using System.Threading.Tasks;
3+
using AwesomeAssertions;
34
using ExpressionCache.Core.Tests.Data;
4-
using FluentAssertions;
55
using Moq;
66
using Xunit;
77

88
namespace ExpressionCache.Core.Tests;
99

10-
public class ExpressionCacheBaseTests : IClassFixture<TestFunctionsFixture>
10+
public class ExpressionCacheBaseTests(TestFunctionsFixture testFunctions) : IClassFixture<TestFunctionsFixture>
1111
{
12-
private readonly TestFunctionsFixture _testFunctions;
13-
14-
public ExpressionCacheBaseTests(TestFunctionsFixture testFunctions)
15-
{
16-
_testFunctions = testFunctions;
17-
}
18-
1912
[Fact]
2013
public void GetKey_FunctionWithoutParameters_ShouldReturnCacheKeyString()
2114
{
2215
using var fixture = new ExpressionCacheBaseFixture();
23-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParameters());
24-
var asyncKey = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParametersAsync());
16+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParameters());
17+
var asyncKey = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParametersAsync());
2518

2619
key.Should().Be(CacheKeyHelper.Prefix(
27-
CacheKeyHelper.Format(_testFunctions.ClassName) +
28-
CacheKeyHelper.Format(nameof(_testFunctions.FunctionWithoutParameters))));
20+
CacheKeyHelper.Format(testFunctions.ClassName) +
21+
CacheKeyHelper.Format(nameof(testFunctions.FunctionWithoutParameters))));
2922
asyncKey.Should().Be(CacheKeyHelper.Prefix(
30-
CacheKeyHelper.Format(_testFunctions.ClassName) +
31-
CacheKeyHelper.Format(nameof(_testFunctions.FunctionWithoutParametersAsync))));
23+
CacheKeyHelper.Format(testFunctions.ClassName) +
24+
CacheKeyHelper.Format(nameof(testFunctions.FunctionWithoutParametersAsync))));
3225
}
3326

3427
[Fact]
@@ -37,16 +30,16 @@ public void GetKey_FunctionWithOneParameter_ShouldReturnCacheKeyString()
3730
const int parameter = 1;
3831

3932
using var fixture = new ExpressionCacheBaseFixture();
40-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithOneParameter(parameter));
41-
var asyncKey = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithOneParameterAsync(parameter));
33+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithOneParameter(parameter));
34+
var asyncKey = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithOneParameterAsync(parameter));
4235

4336
key.Should().Be(CacheKeyHelper.Prefix(
44-
CacheKeyHelper.Format(_testFunctions.ClassName) +
45-
CacheKeyHelper.Format(nameof(_testFunctions.FunctionWithOneParameter)) +
37+
CacheKeyHelper.Format(testFunctions.ClassName) +
38+
CacheKeyHelper.Format(nameof(testFunctions.FunctionWithOneParameter)) +
4639
CacheKeyHelper.Format(parameter)));
4740
asyncKey.Should().Be(CacheKeyHelper.Prefix(
48-
CacheKeyHelper.Format(_testFunctions.ClassName) +
49-
CacheKeyHelper.Format(nameof(_testFunctions.FunctionWithOneParameterAsync)) +
41+
CacheKeyHelper.Format(testFunctions.ClassName) +
42+
CacheKeyHelper.Format(nameof(testFunctions.FunctionWithOneParameterAsync)) +
5043
CacheKeyHelper.Format(parameter)));
5144
}
5245

@@ -57,25 +50,25 @@ public void GetKey_FunctionWithTwoParameters_ShouldReturnCacheKeyString()
5750
const string parameterTwo = "Testing";
5851

5952
using var fixture = new ExpressionCacheBaseFixture();
60-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithTwoParameters(parameterOne, parameterTwo));
61-
var asyncKey = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithTwoParametersAsync(parameterOne, parameterTwo));
53+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithTwoParameters(parameterOne, parameterTwo));
54+
var asyncKey = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithTwoParametersAsync(parameterOne, parameterTwo));
6255

6356
key.Should().Be(CacheKeyHelper.Prefix(
64-
CacheKeyHelper.Format(_testFunctions.ClassName) +
65-
CacheKeyHelper.Format(nameof(_testFunctions.FunctionWithTwoParameters)) +
57+
CacheKeyHelper.Format(testFunctions.ClassName) +
58+
CacheKeyHelper.Format(nameof(testFunctions.FunctionWithTwoParameters)) +
6659
CacheKeyHelper.Format(parameterOne) +
6760
CacheKeyHelper.Format(parameterTwo)));
6861
asyncKey.Should().Be(CacheKeyHelper.Prefix(
69-
CacheKeyHelper.Format(_testFunctions.ClassName) +
70-
CacheKeyHelper.Format(nameof(_testFunctions.FunctionWithTwoParametersAsync)) +
62+
CacheKeyHelper.Format(testFunctions.ClassName) +
63+
CacheKeyHelper.Format(nameof(testFunctions.FunctionWithTwoParametersAsync)) +
7164
CacheKeyHelper.Format(parameterOne) +
7265
CacheKeyHelper.Format(parameterTwo)));
7366
}
7467

7568
[Fact]
7669
public void GetKey_NonFunction_ShouldThrowArgumentException()
7770
{
78-
Action act = () =>
71+
var act = () =>
7972
{
8073
using var fixture = new ExpressionCacheBaseFixture();
8174
fixture.ExpressionCacheBase.GetKey(() => 1 + 2);
@@ -89,9 +82,9 @@ public void InvokeCache_ResultInCache_ShouldReturnCachedResult()
8982
{
9083
using var fixture = new ExpressionCacheBaseFixture();
9184
fixture.SetCacheProviderGetSuccess();
92-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParameters());
85+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParameters());
9386

94-
var result = fixture.ExpressionCacheBase.InvokeCache(() => _testFunctions.FunctionWithoutParameters(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
87+
var result = fixture.ExpressionCacheBase.InvokeCache(() => testFunctions.FunctionWithoutParameters(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
9588

9689
result.Should().Be(ExpressionCacheBaseFixture.CachedResult);
9790
fixture.CacheProviderMock.Verify(m => m.Get<string>(key), Times.Once);
@@ -103,9 +96,9 @@ public async Task InvokeCacheAsync_ResultInCache_ShouldReturnCachedResult()
10396
{
10497
using var fixture = new ExpressionCacheBaseFixture();
10598
fixture.SetCacheProviderGetAsyncSuccess();
106-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParametersAsync());
99+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParametersAsync());
107100

108-
var result = await fixture.ExpressionCacheBase.InvokeCacheAsync(() => _testFunctions.FunctionWithoutParametersAsync(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
101+
var result = await fixture.ExpressionCacheBase.InvokeCacheAsync(() => testFunctions.FunctionWithoutParametersAsync(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
109102

110103
result.Should().Be(ExpressionCacheBaseFixture.CachedResult);
111104
fixture.CacheProviderMock.Verify(m => m.GetAsync<string>(key), Times.Once);
@@ -117,9 +110,9 @@ public void InvokeCache_ResultNotInCache_ShouldCacheAndReturnResult()
117110
{
118111
using var fixture = new ExpressionCacheBaseFixture();
119112
fixture.SetCacheProviderGetFailure();
120-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParameters());
113+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParameters());
121114

122-
var result = fixture.ExpressionCacheBase.InvokeCache(() => _testFunctions.FunctionWithoutParameters(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
115+
var result = fixture.ExpressionCacheBase.InvokeCache(() => testFunctions.FunctionWithoutParameters(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
123116

124117
result.Should().Be(TestFunctionsFixture.ReturnResult);
125118
fixture.CacheProviderMock.Verify(m => m.Get<string>(key), Times.Once);
@@ -131,9 +124,9 @@ public async Task InvokeCacheAsync_ResultNotInCache_ShouldCacheAndReturnResult()
131124
{
132125
using var fixture = new ExpressionCacheBaseFixture();
133126
fixture.SetCacheProviderGetAsyncFailure();
134-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParametersAsync());
127+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParametersAsync());
135128

136-
var result = await fixture.ExpressionCacheBase.InvokeCacheAsync(() => _testFunctions.FunctionWithoutParametersAsync(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
129+
var result = await fixture.ExpressionCacheBase.InvokeCacheAsync(() => testFunctions.FunctionWithoutParametersAsync(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
137130

138131
result.Should().Be(TestFunctionsFixture.ReturnResult);
139132
fixture.CacheProviderMock.Verify(m => m.GetAsync<string>(key), Times.Once);
@@ -145,9 +138,9 @@ public void InvokeCache_NullFunction_ShouldNotCacheNull()
145138
{
146139
using var fixture = new ExpressionCacheBaseFixture();
147140
fixture.SetCacheProviderGetFailure();
148-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParameters());
141+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParameters());
149142

150-
var result = fixture.ExpressionCacheBase.InvokeCache(() => _testFunctions.NullFunctionWithoutParameters(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
143+
var result = fixture.ExpressionCacheBase.InvokeCache(() => testFunctions.NullFunctionWithoutParameters(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
151144

152145
result.Should().BeNull();
153146
fixture.CacheProviderMock.Verify(m => m.Get<string>(key), Times.Never);
@@ -159,9 +152,9 @@ public async Task InvokeCacheAsync_NullFunction_ShouldNotCacheNull()
159152
{
160153
using var fixture = new ExpressionCacheBaseFixture();
161154
fixture.SetCacheProviderGetAsyncFailure();
162-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParametersAsync());
155+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParametersAsync());
163156

164-
var result = await fixture.ExpressionCacheBase.InvokeCacheAsync(() => _testFunctions.NullFunctionWithoutParametersAsync(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
157+
var result = await fixture.ExpressionCacheBase.InvokeCacheAsync(() => testFunctions.NullFunctionWithoutParametersAsync(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Invoke);
165158

166159
result.Should().BeNull();
167160
fixture.CacheProviderMock.Verify(m => m.GetAsync<string>(key), Times.Never);
@@ -173,9 +166,9 @@ public void InvokeCache_Overwrite_ShouldReturnNewValueAndCache()
173166
{
174167
using var fixture = new ExpressionCacheBaseFixture();
175168
fixture.SetCacheProviderGetSuccess();
176-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParameters());
169+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParameters());
177170

178-
var result = fixture.ExpressionCacheBase.InvokeCache(() => _testFunctions.FunctionWithoutParameters(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Overwrite);
171+
var result = fixture.ExpressionCacheBase.InvokeCache(() => testFunctions.FunctionWithoutParameters(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Overwrite);
179172

180173
result.Should().Be(TestFunctionsFixture.ReturnResult);
181174
fixture.CacheProviderMock.Verify(m => m.Get<string>(key), Times.Never);
@@ -187,9 +180,9 @@ public async Task InvokeCacheAsync_Overwrite_ShouldReturnNewValueAndCache()
187180
{
188181
using var fixture = new ExpressionCacheBaseFixture();
189182
fixture.SetCacheProviderGetAsyncSuccess();
190-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParametersAsync());
183+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParametersAsync());
191184

192-
var result = await fixture.ExpressionCacheBase.InvokeCacheAsync(() => _testFunctions.FunctionWithoutParametersAsync(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Overwrite);
185+
var result = await fixture.ExpressionCacheBase.InvokeCacheAsync(() => testFunctions.FunctionWithoutParametersAsync(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Overwrite);
193186

194187
result.Should().Be(TestFunctionsFixture.ReturnResult);
195188
fixture.CacheProviderMock.Verify(m => m.GetAsync<string>(key), Times.Never);
@@ -201,9 +194,9 @@ public void InvokeCache_Bypass_ShouldReturnNewValueAndCache()
201194
{
202195
using var fixture = new ExpressionCacheBaseFixture();
203196
fixture.SetCacheProviderGetSuccess();
204-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParameters());
197+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParameters());
205198

206-
var result = fixture.ExpressionCacheBase.InvokeCache(() => _testFunctions.FunctionWithoutParameters(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Bypass);
199+
var result = fixture.ExpressionCacheBase.InvokeCache(() => testFunctions.FunctionWithoutParameters(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Bypass);
207200

208201
result.Should().Be(TestFunctionsFixture.ReturnResult);
209202
fixture.CacheProviderMock.Verify(m => m.Get<string>(key), Times.Never);
@@ -215,9 +208,9 @@ public async Task InvokeCacheAsync_Bypass_ShouldReturnNewValueAndCache()
215208
{
216209
using var fixture = new ExpressionCacheBaseFixture();
217210
fixture.SetCacheProviderGetAsyncSuccess();
218-
var key = fixture.ExpressionCacheBase.GetKey(() => _testFunctions.FunctionWithoutParametersAsync());
211+
var key = fixture.ExpressionCacheBase.GetKey(() => testFunctions.FunctionWithoutParametersAsync());
219212

220-
var result = await fixture.ExpressionCacheBase.InvokeCacheAsync(() => _testFunctions.FunctionWithoutParametersAsync(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Bypass);
213+
var result = await fixture.ExpressionCacheBase.InvokeCacheAsync(() => testFunctions.FunctionWithoutParametersAsync(), ExpressionCacheBaseFixture.TimeSpan, CacheAction.Bypass);
221214

222215
result.Should().Be(TestFunctionsFixture.ReturnResult);
223216
fixture.CacheProviderMock.Verify(m => m.GetAsync<string>(key), Times.Never);

0 commit comments

Comments
 (0)