Skip to content

Commit 25c909c

Browse files
committed
Upgrade to .net 9.0
1 parent bd11dab commit 25c909c

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: .NET 5
1+
name: .NET
22

33
on:
44
push:
@@ -12,11 +12,11 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- name: Setup .NET
17-
uses: actions/setup-dotnet@v1
17+
uses: actions/setup-dotnet@v4
1818
with:
19-
dotnet-version: 5.0.x
19+
dotnet-version: 9.0.x
2020
- name: Restore dependencies
2121
run: dotnet restore
2222
- name: Build

MemoryCacheNetCore.Tests/InMemoryCacheTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Collections.Generic;
44
using System.Linq;
55
using System.Threading.Tasks;
6-
using FluentAssertions;
6+
using AwesomeAssertions;
77
using Microsoft.VisualStudio.TestTools.UnitTesting;
88

99
namespace MemoryCacheNetCore.Tests
@@ -16,7 +16,7 @@ public class InMemoryCacheTests
1616
private const int MoreThanCacheDurationInSeconds = 3;
1717
private static readonly Random Random = new(Guid.NewGuid().GetHashCode());
1818

19-
[TestMethod, Timeout(Timeout)]
19+
[TestMethod, Timeout(Timeout, CooperativeCancellation = true)]
2020
public async Task Get_Old_Value_When_Delay_Is_Not_Expired()
2121
{
2222
var cache = new InMemoryCache(CacheDurationInSeconds);
@@ -40,7 +40,7 @@ public async Task Get_Old_Value_When_Delay_Is_Not_Expired()
4040
yy.Should().Be(10);
4141
}
4242

43-
[TestMethod, Timeout(Timeout)]
43+
[TestMethod, Timeout(Timeout, CooperativeCancellation = true)]
4444
public async Task Get_New_Value_When_Delay_Is_Expired()
4545
{
4646
var cache = new InMemoryCache(CacheDurationInSeconds);
@@ -66,7 +66,7 @@ public async Task Get_New_Value_When_Delay_Is_Expired()
6666
yy.Should().Be(20);
6767
}
6868

69-
[TestMethod, Timeout(Timeout)]
69+
[TestMethod, Timeout(Timeout, CooperativeCancellation = true)]
7070
public async Task Get_New_Value_When_Delay_Is_Not_Expired_And_Cache_Was_Flushed()
7171
{
7272
var cache = new InMemoryCache(CacheDurationInSeconds);
@@ -92,7 +92,7 @@ public async Task Get_New_Value_When_Delay_Is_Not_Expired_And_Cache_Was_Flushed(
9292
yy.Should().Be(20);
9393
}
9494

95-
[TestMethod, Timeout(Timeout)]
95+
[TestMethod, Timeout(Timeout, CooperativeCancellation = true)]
9696
public async Task Should_Not_Throw_Exception_When_Cache_Is_Flushed_While_Is_Used_V1()
9797
{
9898
try
@@ -105,7 +105,7 @@ public async Task Should_Not_Throw_Exception_When_Cache_Is_Flushed_While_Is_Used
105105
}
106106
}
107107

108-
[TestMethod, Timeout(Timeout)]
108+
[TestMethod, Timeout(Timeout, CooperativeCancellation = true)]
109109
public async Task Should_Not_Throw_Exception_When_Cache_Is_Flushed_While_Is_Used_V2()
110110
{
111111
var cache = new InMemoryCache(CacheDurationInSeconds);
@@ -144,7 +144,7 @@ await Task.Run(async () =>
144144
cache.Size.Should().BeGreaterThan(0);
145145
}
146146

147-
[TestMethod, Timeout(Timeout)]
147+
[TestMethod, Timeout(Timeout, CooperativeCancellation = true)]
148148
public async Task Should_Not_Throw_Exception_When_Cache_Is_Flushed_While_Is_Used_V3()
149149
{
150150
var cache = new InMemoryCache(CacheDurationInSeconds);

MemoryCacheNetCore.Tests/MemoryCacheNetCore.Tests.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
5-
4+
<TargetFramework>net9.0</TargetFramework>
65
<IsPackable>false</IsPackable>
76
</PropertyGroup>
87

98
<ItemGroup>
10-
<PackageReference Include="FluentAssertions" Version="5.10.3" />
9+
<PackageReference Include="AwesomeAssertions" Version="9.1.0" />
1110
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
12-
<PackageReference Include="MSTest.TestAdapter" Version="2.2.5" />
13-
<PackageReference Include="MSTest.TestFramework" Version="2.2.5" />
11+
<PackageReference Include="MSTest.TestAdapter" Version="3.10.2" />
12+
<PackageReference Include="MSTest.TestFramework" Version="3.10.2" />
1413
</ItemGroup>
1514

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

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
8+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
99
</ItemGroup>
1010

1111
</Project>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ In this demo, i m proposing a MemoryCache wrapper in order to :
1313
> :writing_hand: `Clear Keys/Entries`
1414
>
1515
16-
**`Tools`** : vs19, net 5.0
16+
**`Tools`** : net 9.0

0 commit comments

Comments
 (0)