Skip to content

Commit 64cb7ea

Browse files
committed
cip update deps, adapt test api changes
1 parent 91ca77e commit 64cb7ea

18 files changed

+70
-90
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
build_version_base:
77
description: 'Build version number X.Y.Z'
88
required: false
9-
default: 0.10.0
9+
default: 0.11.0
1010

1111
jobs:
1212

@@ -27,17 +27,17 @@ jobs:
2727
steps:
2828

2929
- name: Checkout
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@v6
3131
with:
3232
fetch-depth: 0
3333

3434
- name: Setup NuGet
3535
uses: NuGet/setup-nuget@v2
3636

3737
- name: Install .NET
38-
uses: actions/setup-dotnet@v4
38+
uses: actions/setup-dotnet@v5
3939
with:
40-
dotnet-version: 9.0.x
40+
dotnet-version: 10.0.x
4141

4242
# Create the NuGet packages in the folder from the environment variable NuGetDirectory
4343
- name: Build NuGet packages

.github/workflows/verify.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@ jobs:
1616
linux-build:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v6
2020
with:
2121
fetch-depth: 0
2222
- name: Setup .NET
23-
uses: actions/setup-dotnet@v4
23+
uses: actions/setup-dotnet@v5
2424
with:
25-
dotnet-version: '9.0.x'
25+
dotnet-version: '10.0.x'
2626
- name: Set up JDK 17
27-
uses: actions/setup-java@v4
27+
uses: actions/setup-java@v5
2828
with:
2929
java-version: 17
3030
distribution: 'zulu'
3131
- name: Cache SonarCloud packages
32-
uses: actions/cache@v4
32+
uses: actions/cache@v5
3333
with:
3434
path: ~/sonar/cache
3535
key: ${{ runner.os }}-sonar
3636
restore-keys: ${{ runner.os }}-sonar
3737
- name: Cache SonarCloud scanner
3838
id: cache-sonar-scanner
39-
uses: actions/cache@v4
39+
uses: actions/cache@v5
4040
with:
4141
path: ./.sonar/scanner
4242
key: ${{ runner.os }}-sonar-scanner
@@ -62,15 +62,15 @@ jobs:
6262
run: |
6363
$currentDirectory = Get-Location
6464
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net8.0 --coverage-output $currentDirectory/coverage/net8.0/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
65-
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net9.0 --coverage-output $currentDirectory/coverage/net9.0/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
65+
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net10.0 --coverage-output $currentDirectory/coverage/net10.0/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
6666
- name: SonarCloud End
6767
env:
6868
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6969
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
7070
shell: pwsh
7171
run: ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
7272
- name: Upload coverage reports to Codecov
73-
uses: codecov/codecov-action@v4
73+
uses: codecov/codecov-action@v5
7474
with:
7575
token: ${{ secrets.CODECOV_TOKEN }}
7676
working-directory: coverage
@@ -79,13 +79,13 @@ jobs:
7979
windows-build:
8080
runs-on: windows-latest
8181
steps:
82-
- uses: actions/checkout@v4
82+
- uses: actions/checkout@v6
8383
with:
8484
fetch-depth: 0
8585
- name: Setup .NET
86-
uses: actions/setup-dotnet@v4
86+
uses: actions/setup-dotnet@v5
8787
with:
88-
dotnet-version: '9.0.x'
88+
dotnet-version: '10.0.x'
8989
- name: Install dependencies
9090
run: dotnet restore CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
9191
- name: Build Tests
@@ -96,9 +96,9 @@ jobs:
9696
$currentDirectory = Get-Location
9797
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net48 --coverage-output $currentDirectory/coverage/net48/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
9898
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net8.0 --coverage-output $currentDirectory/coverage/net8.0/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
99-
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net9.0 --coverage-output $currentDirectory/coverage/net9.0/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
99+
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net10.0 --coverage-output $currentDirectory/coverage/net10.0/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
100100
- name: Upload coverage reports to Codecov
101-
uses: codecov/codecov-action@v4
101+
uses: codecov/codecov-action@v5
102102
with:
103103
token: ${{ secrets.CODECOV_TOKEN }}
104104
working-directory: coverage

CommonNet.Extensions.Tests/CommonNet.DependencyInjection/ServiceCollectionExtensionsTests.cs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ await Assert.That(bif1)
5050
.IsNotNull();
5151

5252
await Assert.That(iif4)
53-
.IsEqualTo(iif3);
53+
.IsSameReferenceAs(iif3);
5454
await Assert.That(iif3)
55-
.IsEqualTo(iif2);
55+
.IsSameReferenceAs(iif2);
5656
await Assert.That(iif2)
57-
.IsEqualTo(bif1);
57+
.IsSameReferenceAs(bif1);
5858

5959
var bif2 = sp.GetRequiredService<IBaseInterface2>();
6060
await Assert.That(bif2)
@@ -104,11 +104,11 @@ await Assert.That(bif1)
104104
.IsNotNull();
105105

106106
await Assert.That(iif4)
107-
.IsEqualTo(iif3);
107+
.IsSameReferenceAs(iif3);
108108
await Assert.That(iif3)
109-
.IsEqualTo(iif2);
109+
.IsSameReferenceAs(iif2);
110110
await Assert.That(iif2)
111-
.IsEqualTo(bif1);
111+
.IsSameReferenceAs(bif1);
112112

113113
var bif2 = sp.GetRequiredService<IBaseInterface2>();
114114
await Assert.That(bif2)
@@ -159,11 +159,11 @@ await Assert.That(bif1)
159159
.IsNotNull();
160160

161161
await Assert.That(iif4)
162-
.IsEqualTo(iif3);
162+
.IsSameReferenceAs(iif3);
163163
await Assert.That(iif3)
164-
.IsEqualTo(iif2);
164+
.IsSameReferenceAs(iif2);
165165
await Assert.That(iif2)
166-
.IsEqualTo(bif1);
166+
.IsSameReferenceAs(bif1);
167167

168168
var bif2 = sp.GetRequiredService<IBaseInterface2>();
169169
await Assert.That(bif2)
@@ -211,17 +211,17 @@ await Assert.That(bif1_1)
211211
.IsNotNull();
212212

213213
await Assert.That(iif4)
214-
.IsNotEqualTo(iif3);
214+
.IsNotSameReferenceAs(iif3);
215215
await Assert.That(iif3)
216-
.IsNotEqualTo(iif2);
216+
.IsNotSameReferenceAs(iif2);
217217
await Assert.That(iif2)
218-
.IsNotEqualTo(bif1_1);
218+
.IsNotSameReferenceAs(bif1_1);
219219

220220
var bif1_2 = sp.GetRequiredService<IBaseInterface1>();
221221
await Assert.That(bif1_2)
222222
.IsNotNull();
223223
await Assert.That(bif1_2)
224-
.IsNotEqualTo(bif1_1);
224+
.IsNotSameReferenceAs(bif1_1);
225225
}
226226

227227
[Test]
@@ -247,17 +247,17 @@ await Assert.That(bif1_1)
247247
.IsNotNull();
248248

249249
await Assert.That(iif4)
250-
.IsNotEqualTo(iif3);
250+
.IsNotSameReferenceAs(iif3);
251251
await Assert.That(iif3)
252-
.IsNotEqualTo(iif2);
252+
.IsNotSameReferenceAs(iif2);
253253
await Assert.That(iif2)
254-
.IsNotEqualTo(bif1_1);
254+
.IsNotSameReferenceAs(bif1_1);
255255

256256
var bif1_2 = sp.GetRequiredService<IBaseInterface1>();
257257
await Assert.That(bif1_2)
258258
.IsNotNull();
259259
await Assert.That(bif1_2)
260-
.IsNotEqualTo(bif1_1);
260+
.IsNotSameReferenceAs(bif1_1);
261261
}
262262

263263
[Test]
@@ -285,11 +285,11 @@ await Assert.That(s1_bif1_1)
285285
.IsNotNull();
286286

287287
await Assert.That(s1_iif4)
288-
.IsEqualTo(s1_iif3);
288+
.IsSameReferenceAs(s1_iif3);
289289
await Assert.That(s1_iif3)
290-
.IsEqualTo(s1_iif2);
290+
.IsSameReferenceAs(s1_iif2);
291291
await Assert.That(s1_iif2)
292-
.IsEqualTo(s1_bif1_1);
292+
.IsSameReferenceAs(s1_bif1_1);
293293

294294
var s1_bif1_2 = scope1.ServiceProvider.GetRequiredService<IBaseInterface1>();
295295
await Assert.That(s1_bif1_2)
@@ -338,11 +338,11 @@ await Assert.That(s1_bif1_1)
338338
.IsNotNull();
339339

340340
await Assert.That(s1_iif4)
341-
.IsEqualTo(s1_iif3);
341+
.IsSameReferenceAs(s1_iif3);
342342
await Assert.That(s1_iif3)
343-
.IsEqualTo(s1_iif2);
343+
.IsSameReferenceAs(s1_iif2);
344344
await Assert.That(s1_iif2)
345-
.IsEqualTo(s1_bif1_1);
345+
.IsSameReferenceAs(s1_bif1_1);
346346

347347
var s1_bif1_2 = scope1.ServiceProvider.GetRequiredService<IBaseInterface1>();
348348
await Assert.That(s1_bif1_2)

CommonNet.Extensions.Tests/CommonNet.Extensions/EmbeddedResourceStreamExtensionsTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Reflection;
22
using System.Text;
3-
using TUnit.Assertions.AssertConditions.Throws;
43
using Assembly = System.Reflection.Assembly;
54

65
#if NET6_0_OR_GREATER

CommonNet.Extensions.Tests/CommonNet.Extensions/EnumExtensionsTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using TUnit.Assertions.AssertConditions.Throws;
2-
3-
namespace CommonNet.Extensions.Tests;
1+
namespace CommonNet.Extensions.Tests;
42

53
public class EnumExtensionsTests
64
{

CommonNet.Extensions.Tests/CommonNet.Extensions/EnumerableExtensionsTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Text;
2-
using TUnit.Assertions.AssertConditions.Throws;
32

43
namespace CommonNet.Extensions.Tests;
54

CommonNet.Extensions.Tests/CommonNet.Extensions/EqualityComparerFactoryTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using TUnit.Assertions.AssertConditions.Throws;
2-
3-
namespace CommonNet.Extensions.Tests;
1+
namespace CommonNet.Extensions.Tests;
42

53
public class EqualityComparerFactoryTests
64
{

CommonNet.Extensions.Tests/CommonNet.Extensions/ExceptionExtensionsTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using TUnit.Assertions.AssertConditions.Throws;
1+
using System.Linq;
22

33
namespace CommonNet.Extensions.Tests;
44

@@ -13,8 +13,8 @@ public async Task AddData_ShouldAddSingleValue_WhenCalledWithOneValue()
1313

1414
exception.AddData(key, value);
1515

16-
await Assert.That(exception.Data)
17-
.ContainsKey(key);
16+
await Assert.That(exception.Data.Keys.OfType<object>())
17+
.Contains(obj => obj is string str && str == key);
1818
await Assert.That(exception.Data[key])
1919
.IsEqualTo(value);
2020
}
@@ -28,8 +28,8 @@ public async Task AddData_ShouldAddArrayOfValues_WhenCalledWithMultipleValues()
2828

2929
exception.AddData(key, values);
3030

31-
await Assert.That(exception.Data)
32-
.ContainsKey(key);
31+
await Assert.That(exception.Data.Keys.OfType<object>())
32+
.Contains(obj => obj is string str && str == key);
3333
await Assert.That(exception.Data[key])
3434
.IsEquivalentTo(values);
3535
}
@@ -42,8 +42,8 @@ public async Task AddData_ShouldAddNull_WhenCalledWithNoValues()
4242

4343
exception.AddData(key);
4444

45-
await Assert.That(exception.Data)
46-
.ContainsKey(key);
45+
await Assert.That(exception.Data.Keys.OfType<object>())
46+
.Contains(obj => obj is string str && str == key);
4747
await Assert.That(exception.Data[key])
4848
.IsNull();
4949
}

CommonNet.Extensions.Tests/CommonNet.Extensions/IPAddressExtensionsTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Net;
22
using System.Net.NetworkInformation;
33
using Moq;
4-
using TUnit.Assertions.AssertConditions.Throws;
54

65
namespace CommonNet.Extensions.Tests;
76

@@ -20,7 +19,7 @@ public async Task Mask_ShouldCorrectlyApplySubnetMask(string ipAddress, string m
2019
var result = ip.Mask(subnetMask);
2120

2221
await Assert.That(result)
23-
.IsEquivalentTo(expectedResult);
22+
.EqualTo(expectedResult);
2423
}
2524

2625
[Test]
@@ -54,7 +53,7 @@ public async Task Mask_ShouldHandleIPv6Addresses()
5453
var result = ip.Mask(subnetMask);
5554

5655
await Assert.That(result)
57-
.IsEquivalentTo(expected);
56+
.EqualTo(expected);
5857
}
5958

6059
[Test]
@@ -85,7 +84,7 @@ public async Task GetLocalIpv4AddressOnTheSameNetwork_ShouldFindMatchingAddress_
8584
{
8685
var result = targetIPAddress.GetLocalAddressOnTheSameNetwork(interfaces);
8786
await Assert.That(result)
88-
.IsEquivalentTo(localIPAddress);
87+
.EqualTo(localIPAddress);
8988
}
9089
else
9190
{
@@ -122,7 +121,7 @@ public async Task GetLocalIpv6AddressOnTheSameNetwork_ShouldFindMatchingAddress_
122121
{
123122
var result = targetIPAddress.GetLocalAddressOnTheSameNetwork(interfaces);
124123
await Assert.That(result)
125-
.IsEquivalentTo(localIPAddress);
124+
.EqualTo(localIPAddress);
126125
}
127126
else
128127
{

CommonNet.Extensions.Tests/CommonNet.Extensions/InteropExtensionsTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Runtime.InteropServices;
2-
using TUnit.Assertions.AssertConditions.Throws;
32

43
namespace CommonNet.Extensions.Tests;
54

@@ -65,7 +64,7 @@ await Assert.That(CapturePart(t2))
6564
.IsEquivalentTo(new byte[] { 5, 6, 7, 8 });
6665
}
6766

68-
private unsafe byte[] CapturePart(T2 t2)
67+
private static unsafe byte[] CapturePart(T2 t2)
6968
{
7069
return new ReadOnlySpan<byte>(t2.Data, 4).ToArray();
7170
}

0 commit comments

Comments
 (0)