File tree Expand file tree Collapse file tree 2 files changed +2
-7
lines changed
Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Original file line number Diff line number Diff line change 11namespace Docker . DotNet ;
22
33internal class JsonRequestContent < T > : IRequestContent
4+ where T : class
45{
56 private readonly T _value ;
67 private readonly JsonSerializer _serializer ;
78
89 public JsonRequestContent ( T val , JsonSerializer serializer )
910 {
10- if ( EqualityComparer < T > . Default . Equals ( val , default ) )
11+ if ( val == null )
1112 {
1213 throw new ArgumentNullException ( nameof ( val ) ) ;
1314 }
Original file line number Diff line number Diff line change @@ -10,12 +10,6 @@ public void Constructor_ThrowsArgumentNullException_WhenValueIsNull()
1010 Assert . Throws < ArgumentNullException > ( ( ) => new JsonRequestContent < object > ( null , JsonSerializer . Instance ) ) ;
1111 }
1212
13- [ Fact ]
14- public void Constructor_ThrowsArgumentNullException_WhenValueIsDefault ( )
15- {
16- Assert . Throws < ArgumentNullException > ( ( ) => new JsonRequestContent < int > ( 0 , JsonSerializer . Instance ) ) ;
17- }
18-
1913 [ Fact ]
2014 public void Constructor_ThrowsArgumentNullException_WhenSerializerIsNull ( )
2115 {
You can’t perform that action at this time.
0 commit comments