File tree Expand file tree Collapse file tree
ReflectorNet.Tests.OuterAssembly Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,17 +11,16 @@ permissions:
1111
1212jobs :
1313 build-and-test :
14- runs-on : ${{ matrix.os }}
15- strategy :
16- matrix :
17- os : [ubuntu-latest]
18- dotnet-version : [ '9.0.x' ]
14+ runs-on : ubuntu-latest
1915 steps :
2016 - uses : actions/checkout@v4
21- - name : Setup .NET ${{ matrix.dotnet-version }}
17+ - name : Setup .NET
2218 uses : actions/setup-dotnet@v4
2319 with :
24- dotnet-version : ${{ matrix.dotnet-version }}
20+ dotnet-version : |
21+ 6.0.x
22+ 8.0.x
23+ 9.0.x
2524 - name : Restore dependencies
2625 run : dotnet restore
2726 - name : Build
Original file line number Diff line number Diff line change @@ -52,19 +52,18 @@ jobs:
5252 echo "Version tag '${{ steps.get_version.outputs.version }}' does not exist. Proceeding with release process."
5353
5454 build-and-test :
55- runs-on : ${{ matrix.os }}
55+ runs-on : ubuntu-latest
5656 needs : check-version-tag
5757 if : needs.check-version-tag.outputs.is_new_version == 'true'
58- strategy :
59- matrix :
60- os : [ubuntu-latest]
61- dotnet-version : [ '9.0.x' ]
6258 steps :
6359 - uses : actions/checkout@v4
64- - name : Setup .NET ${{ matrix.dotnet-version }}
60+ - name : Setup .NET
6561 uses : actions/setup-dotnet@v4
6662 with :
67- dotnet-version : ${{ matrix.dotnet-version }}
63+ dotnet-version : |
64+ 6.0.x
65+ 8.0.x
66+ 9.0.x
6867
6968 - name : Restore dependencies
7069 run : dotnet restore
@@ -158,7 +157,10 @@ jobs:
158157 - name : Setup .NET
159158 uses : actions/setup-dotnet@v4
160159 with :
161- dotnet-version : ' 9.0.x'
160+ dotnet-version : |
161+ 6.0.x
162+ 8.0.x
163+ 9.0.x
162164
163165 - name : Restore dependencies
164166 run : dotnet restore
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFrameworks >net8.0;net9.0</TargetFrameworks >
4+ <TargetFrameworks >net6.0; net8.0;net9.0</TargetFrameworks >
55 <ImplicitUsings >disable</ImplicitUsings >
66 <Nullable >enable</Nullable >
77 <IsPackable >false</IsPackable >
88 </PropertyGroup >
99
10- <ItemGroup >
10+ <ItemGroup Condition =" '$(TargetFramework)' == 'net6.0'" >
11+ <PackageReference Include =" System.Text.Json" Version =" 8.0.5" />
12+ </ItemGroup >
13+
14+ <ItemGroup Condition =" '$(TargetFramework)' != 'net6.0'" >
1115 <PackageReference Include =" System.Text.Json" Version =" 9.0.10" />
1216 </ItemGroup >
1317
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFrameworks >net8.0;net9.0</TargetFrameworks >
4+ <TargetFrameworks >net6.0; net8.0;net9.0</TargetFrameworks >
55 <LangVersion >11.0</LangVersion >
66 <ImplicitUsings >disable</ImplicitUsings >
77 <Nullable >enable</Nullable >
88 <IsPackable >false</IsPackable >
99 </PropertyGroup >
1010
11- <ItemGroup >
11+ <ItemGroup Condition =" '$(TargetFramework)' == 'net6.0'" >
12+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.11.1" />
13+ <PackageReference Include =" System.Text.Json" Version =" 8.0.5" />
14+ <PackageReference Include =" xunit" Version =" 2.9.3" />
15+ <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.8.2" >
16+ <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
17+ <PrivateAssets >all</PrivateAssets >
18+ </PackageReference >
19+ </ItemGroup >
20+
21+ <ItemGroup Condition =" '$(TargetFramework)' != 'net6.0'" >
1222 <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 18.0.0" />
1323 <PackageReference Include =" System.Text.Json" Version =" 9.0.10" />
1424 <PackageReference Include =" xunit" Version =" 2.9.3" />
Original file line number Diff line number Diff line change @@ -57,8 +57,13 @@ public void GetTypeId_SimpleArray_ShouldAppendArray()
5757 foreach ( var type in _collectionTypes )
5858 {
5959 var result = reflector . GetSchema ( type ) ;
60+ var options = new JsonSerializerOptions
61+ {
62+ TypeInfoResolver = new System . Text . Json . Serialization . Metadata . DefaultJsonTypeInfoResolver ( ) ,
63+ WriteIndented = true
64+ } ;
6065
61- _output . WriteLine ( $ "Type: { type . GetTypeShortName ( ) } \n { result . ToJsonString ( new JsonSerializerOptions { WriteIndented = true } ) } \n ") ;
66+ _output . WriteLine ( $ "Type: { type . GetTypeShortName ( ) } \n { result . ToJsonString ( options ) } \n ") ;
6267
6368 // Assert
6469 Assert . NotNull ( result ) ;
You can’t perform that action at this time.
0 commit comments