File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . IO ;
3
+ using System . Collections . Generic ;
4
+ using System . Collections . ObjectModel ;
5
+ using System . Linq ;
6
+ using System . Reflection ;
7
+ using Newtonsoft . Json ;
8
+ using Newtonsoft . Json . Serialization ;
9
+ using RestSharp ;
10
+ using Xunit ;
11
+
12
+ using Org . OpenAPITools . Client ;
13
+ using Org . OpenAPITools . Api ;
14
+ using Org . OpenAPITools . Model ;
15
+
16
+ namespace Org . OpenAPITools . Test
17
+ {
18
+ /// <summary>
19
+ /// Class for testing ApiClient
20
+ /// </summary>
21
+ public class ApiClientTests
22
+ {
23
+ public ApiClientTests ( )
24
+ {
25
+ }
26
+
27
+ /// <summary>
28
+ /// Test GetSerializerSettingsTest
29
+ /// </summary>
30
+ [ Fact ]
31
+ public void GetSerializerSettingsTest ( )
32
+ {
33
+ ApiClient apiClient = new ApiClient ( ) ;
34
+
35
+ var serializerSettingsPropertyInfo = typeof ( ApiClient ) . GetProperty ( nameof ( ApiClient . SerializerSettings ) ) ;
36
+
37
+ // Validate that we can the set the SerializerSettings (public visibility)
38
+ Assert . NotNull ( serializerSettingsPropertyInfo ? . GetSetMethod ( ) ) ;
39
+
40
+ // Validate default serializer settings
41
+ Assert . NotNull ( apiClient . SerializerSettings ) ;
42
+ Assert . Equal ( ConstructorHandling . AllowNonPublicDefaultConstructor , apiClient . SerializerSettings . ConstructorHandling ) ;
43
+ Assert . False ( ( ( DefaultContractResolver ) apiClient . SerializerSettings . ContractResolver ) . NamingStrategy . OverrideSpecifiedNames ) ;
44
+ }
45
+ }
46
+ }
You can’t perform that action at this time.
0 commit comments