Skip to content

Commit fea6f5a

Browse files
authored
Merge pull request #60 from Mbucari/master
Update to .NET 10
2 parents 55f0056 + 27eaf12 commit fea6f5a

31 files changed

+117
-118
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525

2626
env:
2727
DOTNET_CONFIGURATION: 'Release'
28-
DOTNET_VERSION: '9.0.x'
28+
DOTNET_VERSION: '10.x'
2929
NUGET_SOURCE: 'https://api.nuget.org/v3/index.json'
3030

3131
jobs:

AudibleApi.Common/AudibleApi.Common.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Version>9.5.0.1</Version>
66
<AllowedOutputExtensionsInPackageBuildOutputFolder>
77
$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
@@ -14,7 +14,7 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Dinah.Core" Version="9.0.3.1" />
17+
<PackageReference Include="Dinah.Core" Version="10.0.0.1" />
1818
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
1919
</ItemGroup>
2020

AudibleApi.nuspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
<readme>docs\README.md</readme>
1313
<license type="file">lic</license>
1414
<dependencies>
15-
<group targetFramework="net9.0">
16-
<dependency id="Dinah.Core" version="9.0.3.1" />
15+
<group targetFramework="net10.0">
16+
<dependency id="Dinah.Core" version="10.0.0.1" />
1717
</group>
1818
</dependencies>
1919
</metadata>
2020
<dependencies>
21-
<group targetFramework="net9.0">
21+
<group targetFramework="net10.0">
2222
<dependency id="AudibleApi.Common" />
2323
</group>
2424
</dependencies>
2525
<files>
26-
<file src="AudibleApi\bin\Release\net9.0\AudibleApi.dll" target="lib\net9.0\" />
27-
<file src="AudibleApi\bin\Release\net9.0\AudibleApi.Common.dll" target="lib\net9.0\" />
26+
<file src="AudibleApi\bin\Release\net10.0\AudibleApi.dll" target="lib\net10.0\" />
27+
<file src="AudibleApi\bin\Release\net10.0\AudibleApi.Common.dll" target="lib\net10.0\" />
2828

2929
<file src="README.md" target="docs\" />
3030
<file src="LICENSE" target="lic" />

AudibleApi/AudibleApi.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Version>9.5.0.1</Version>
66
<AllowedOutputExtensionsInPackageBuildOutputFolder>
77
$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
@@ -14,7 +14,6 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
1817
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
1918
</ItemGroup>
2019

AudibleApi/Cryptography/XXTEA.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static byte[] Encrypt(ReadOnlySpan<byte> clearBytes, uint[] key)
1818
int n = (int)Math.Ceiling(clearBytes.Length / 4d);
1919

2020
byte[] cipherBytes = new byte[n * sizeof(uint)];
21-
Span<uint> transformBuffer = MemoryMarshal.Cast<byte, uint>(cipherBytes);
21+
Span<uint> transformBuffer = MemoryMarshal.Cast<byte, uint>(cipherBytes.AsSpan());
2222
clearBytes.CopyTo(cipherBytes);
2323

2424
Transform(transformBuffer, key, encrypting: true);
@@ -34,7 +34,7 @@ public static byte[] Decrypt(ReadOnlySpan<byte> cipherBytes, uint[] key)
3434
int n = (int)Math.Ceiling(cipherBytes.Length / 4d);
3535

3636
byte[] clearBytes = new byte[n * sizeof(uint)];
37-
Span<uint> transformBuffer = MemoryMarshal.Cast<byte, uint>(clearBytes);
37+
Span<uint> transformBuffer = MemoryMarshal.Cast<byte, uint>(clearBytes.AsSpan());
3838
cipherBytes.CopyTo(clearBytes);
3939

4040
Transform(transformBuffer, key, encrypting: false);

_Demos/AudibleApiClientExample/AudibleApiClientExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

_Tests/AudibleApi.Common.Tests/AudibleApi.Common.Tests.csproj

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

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

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
11-
<PackageReference Include="MSTest.TestAdapter" Version="3.10.2" />
12-
<PackageReference Include="MSTest.TestFramework" Version="3.10.2" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
11+
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
12+
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
1313
<PackageReference Include="coverlet.collector" Version="6.0.4">
1414
<PrivateAssets>all</PrivateAssets>
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

_Tests/AudibleApi.Tests/AudibleApi.Tests.csproj

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

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

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
11-
<PackageReference Include="MSTest.TestAdapter" Version="3.10.2" />
12-
<PackageReference Include="MSTest.TestFramework" Version="3.10.2" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
11+
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
12+
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
1313
<PackageReference Include="NSubstitute" Version="5.3.0" />
1414
<PackageReference Include="Shouldly" Version="4.3.0" />
1515
</ItemGroup>

_Tests/AudibleApi.Tests/EzApiCreatorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ public class GetApiAsync
55
{
66
[TestMethod]
77
public async Task access_from_L0_throws()
8-
=> await Assert.ThrowsExceptionAsync<MethodAccessException>(() => EzApiCreator.GetApiAsync(Locale.Empty, null));
8+
=> await Assert.ThrowsAsync<MethodAccessException>(() => EzApiCreator.GetApiAsync(Locale.Empty, null));
99
}
1010
}

_Tests/AudibleApi.Tests/L0/ApiClientTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ public class Create
55
{
66
[TestMethod]
77
public void access_from_L0_throws()
8-
=> Assert.ThrowsException<MethodAccessException>(() => ApiHttpClient.Create());
8+
=> Assert.Throws<MethodAccessException>(() => ApiHttpClient.Create());
99
}
1010

1111
[TestClass]
1212
public class Create_innerHandler
1313
{
1414
[TestMethod]
1515
public void null_param_throws()
16-
=> Assert.ThrowsException<ArgumentNullException>(() => ApiHttpClient.Create(null));
16+
=> Assert.Throws<ArgumentNullException>(() => ApiHttpClient.Create(null));
1717

1818
[TestMethod]
1919
public void has_cookies_throws()
@@ -23,7 +23,7 @@ public void has_cookies_throws()
2323
CookieContainer = new CookieContainer()
2424
};
2525
httpClientHandler.CookieContainer.Add(new Cookie("foo", "bar", "/", "a.com"));
26-
Assert.ThrowsException<ArgumentException>(() => ApiHttpClient.Create(httpClientHandler));
26+
Assert.Throws<ArgumentException>(() => ApiHttpClient.Create(httpClientHandler));
2727
}
2828

2929
[TestMethod]
@@ -43,7 +43,7 @@ public async Task throw_api_error()
4343
{ "message", "Invalid response group" }
4444
}.ToString());
4545
var client = ApiHttpClient.Create(handler);
46-
await Assert.ThrowsExceptionAsync<InvalidResponseException>(() => client.GetAsync(new Uri("http://a.com")));
46+
await Assert.ThrowsAsync<InvalidResponseException>(() => client.GetAsync(new Uri("http://a.com")));
4747
}
4848
}
4949
}

0 commit comments

Comments
 (0)