Skip to content

Commit

Permalink
Merge pull request #1 from lyonsil/netframework
Browse files Browse the repository at this point in the history
PR feedback
  • Loading branch information
lyonsil authored Jun 4, 2024
2 parents baa9186 + 08c8b10 commit 464dd0a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/CI-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ jobs:
- name: Build
run: dotnet build --configuration Release source/icu.net.sln

- name: Test
run: dotnet test --configuration Release --no-build source/icu.net.sln -- NUnit.TestOutputXml=TestResults
- name: Test on .NET 8.0
run: dotnet test -p:TargetFramework=net8.0 --configuration Release --no-build source/icu.net.sln -- NUnit.TestOutputXml=TestResults

- name: Test on .NET Framework 4.6.1 (Windows only)
if: ${{ matrix.os == 'windows-latest' }}
run: dotnet test -p:TargetFramework=net461 --configuration Release --no-build source/icu.net.sln -- NUnit.TestOutputXml=TestResults

- name: Upload Test Results
if: always()
Expand Down
2 changes: 1 addition & 1 deletion source/TestHelper/TestHelper.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net461;net8.0</TargetFrameworks>
<OutputPath>../../output/$(Configuration)/TestHelper</OutputPath>
<OutputType>Exe</OutputType>
<RootNamespace>Icu.Tests</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion source/icu.net.tests/ResourceBundleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void GetStringContentsWithKeys()

[TestCase("en_US", ExpectedResult = "[abcdefghijklmnopqrstuvwxyz]")]
[TestCase("de_DE", ExpectedResult = "[aäbcdefghijklmnoöpqrsßtuüvwxyz]")]
[TestCase("fr_FR",ExpectedResult = "[aàâæbcçdeéèêëfghiîïjklmnoôœpqrstuùûüvwxyÿz]")]
[TestCase("fr_FR", ExpectedResult = "[aàâæbcçdeéèêëfghiîïjklmnoôœpqrstuùûüvwxyÿz]")]
public string GetStringByKey(string localeId)
{
using (var resourceBundle = new ResourceBundle(null, localeId))
Expand Down
16 changes: 13 additions & 3 deletions source/icu.net.tests/icu.net.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<!--
If you only want to test on a particular target framework, run "dotnet test -p:TargetFramework=XXX"
For example, on macOS you probably want to run "dotnet test -p:TargetFramework=net8.0" since 4.6.1 isn't supported
-->
<TargetFrameworks>net461;net8.0</TargetFrameworks>
<RootNamespace>Icu.Tests</RootNamespace>
<AssemblyTitle>icu.net.tests</AssemblyTitle>
<IsPackable>false</IsPackable>
Expand All @@ -10,8 +14,14 @@
<PackageReference Include="Icu4c.Win.Min" Version="59.1.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit.Console" Version="3.15.2" />
<!--
Only version 4.3.2 of NUnit3TestAdapter is able to run tests for both .NET 8.0 and .NET Framework 4.6.1.
https://docs.nunit.org/articles/vs-test-adapter/Supported-Frameworks.html
Going forward we're going to have to drop 4.6.1 support to be able to support newer .NET versions.
-->
<PackageReference Include="NUnit3TestAdapter" Version="4.3.2" />
<PackageReference Include="NUnit.Console" Version="3.17.0" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion source/icu.net/NativeMethods/NativeMethodsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static IcuVersionInfo GetIcuVersionInfoForNetCoreOrWindows()
// If this is false, something went wrong. These files should have
// either been found above or we should have been able to locate the
// asset paths (for .NET Core and NuGet v3+ projects).
if (!TryGetNativeAssetPaths(context, out var nativeAssetPaths))
if (!TryGetNativeAssetPaths(context, out var nativeAssetPaths))
{
Trace.WriteLine("Could not locate icu native assets from DependencyModel.");
return IcuVersion;
Expand Down

0 comments on commit 464dd0a

Please sign in to comment.