File tree Expand file tree Collapse file tree 4 files changed +6
-15
lines changed Expand file tree Collapse file tree 4 files changed +6
-15
lines changed Original file line number Diff line number Diff line change 1- using System ;
21using System . Collections . Generic ;
32using System . Net . Http ;
43using System . Threading . Tasks ;
5- using Newtonsoft . Json ;
4+ using System . Text . Json ;
65
76namespace Consumer
87{
98 public struct Product
109 {
11- public string id ;
12- public string type ;
13- public string name ;
10+ public string id { get ; set ; }
11+ public string type { get ; set ; }
12+ public string name { get ; set ; }
1413 }
1514
1615 public class ProductClient
@@ -25,7 +24,7 @@ public class ProductClient
2524
2625 var resp = await response . Content . ReadAsStringAsync ( ) ;
2726
28- return JsonConvert . DeserializeObject < List < Product > > ( resp ) ;
27+ return JsonSerializer . Deserialize < List < Product > > ( resp ) ;
2928 }
3029 }
3130}
Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3- using System . Net . Http ;
4- using System . Threading . Tasks ;
53
64namespace Consumer
75{
Original file line number Diff line number Diff line change 55 <TargetFramework >net8.0</TargetFramework >
66 </PropertyGroup >
77
8- <ItemGroup >
9- <PackageReference Include =" Newtonsoft.Json" Version =" 13.0.3" />
10- </ItemGroup >
11-
128 <ItemGroup >
139 <PackageReference Include =" FluentAssertions" Version =" 6.12.1" />
1410 </ItemGroup >
Original file line number Diff line number Diff line change @@ -16,9 +16,7 @@ namespace tests
1616{
1717 public class ConsumerPactTests
1818 {
19- private IPactBuilderV4 pact ;
20- // private readonly int port = 9222;
21-
19+ private readonly IPactBuilderV4 pact ;
2220 private readonly List < object > products ;
2321
2422 public ConsumerPactTests ( ITestOutputHelper output )
You can’t perform that action at this time.
0 commit comments