Skip to content

Commit e0024e2

Browse files
authored
Switch handwritten test serializer contexts to use source generator (#55844)
1 parent ae7f47d commit e0024e2

File tree

19 files changed

+18
-1077
lines changed

19 files changed

+18
-1077
lines changed

src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContext/Int32.cs

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContext/JsonContext.cs

Lines changed: 0 additions & 60 deletions
This file was deleted.

src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContext/Person.cs

Lines changed: 0 additions & 114 deletions
This file was deleted.

src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContext/String.cs

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/libraries/System.Net.Http.Json/tests/FunctionalTests/System.Net.Http.Json.Functional.Tests.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>$(NetCoreAppCurrent);net48</TargetFrameworks>
44
</PropertyGroup>
55
<ItemGroup>
66
<Compile Include="HttpClientJsonExtensionsTests.cs" />
77
<Compile Include="HttpContentJsonExtensionsTests.cs" />
88
<Compile Include="JsonContentTests.cs" />
9-
<Compile Include="JsonContext\Int32.cs" />
10-
<Compile Include="JsonContext\JsonContext.cs" />
11-
<Compile Include="JsonContext\Person.cs" />
12-
<Compile Include="JsonContext\String.cs" />
139
<Compile Include="TestClasses.cs" />
1410
</ItemGroup>
1511
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
@@ -30,4 +26,7 @@
3026
<Reference Include="System.Net.Http" />
3127
<ProjectReference Include="..\..\src\System.Net.Http.Json.csproj" />
3228
</ItemGroup>
29+
<ItemGroup>
30+
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.Json\gen\System.Text.Json.SourceGeneration.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
31+
</ItemGroup>
3332
</Project>

src/libraries/System.Net.Http.Json/tests/FunctionalTests/TestClasses.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,9 @@ private static void AssertDefaultOptions(JsonSerializerOptions options)
8181

8282
[JsonConverter(typeof(EnsureDefaultOptionsConverter))]
8383
internal class EnsureDefaultOptions { }
84+
85+
[JsonSerializable(typeof(Person))]
86+
internal sealed partial class JsonContext : JsonSerializerContext
87+
{
88+
}
8489
}

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/MetadataTests/JsonContext/DateTimeOffset.cs

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/MetadataTests/JsonContext/Dictionary.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)