@@ -221,13 +221,13 @@ type FSharpValueTests() =
221221
222222 // invalid type
223223 CheckThrowsArgumentException( fun () -> FSharpValue.GetExceptionFields( 1 ) |> ignore)
224- CheckThrowsArgumentException ( fun () -> FSharpValue.GetExceptionFields( () ) |> ignore)
224+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetExceptionFields( () ) |> ignore)
225225
226226 // System Exception
227227 CheckThrowsArgumentException( fun () -> FSharpValue.GetExceptionFields( new System.Exception( " ex message" )) |> ignore)
228228
229229 // null
230- CheckThrowsArgumentException ( fun () -> FSharpValue.GetExceptionFields( null ) |> ignore)
230+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetExceptionFields( null ) |> ignore)
231231
232232 [<Fact>]
233233 member _.GetRecordField () =
@@ -241,15 +241,15 @@ type FSharpValueTests() =
241241 Assert.AreEqual(( FSharpValue.GetRecordField( genericRecordType1, propertyinfo2)), 1 )
242242
243243 // null value
244- CheckThrowsArgumentException ( fun () -> FSharpValue.GetRecordField( null , propertyinfo1)|> ignore)
245- CheckThrowsArgumentException ( fun () -> FSharpValue.GetRecordField( () , propertyinfo1)|> ignore)
244+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetRecordField( null , propertyinfo1)|> ignore)
245+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetRecordField( () , propertyinfo1)|> ignore)
246246
247247 // invalid value
248248 CheckThrowsArgumentException( fun () -> FSharpValue.GetRecordField( " invalid" , propertyinfo1) |> ignore)
249249
250250 // invalid property info
251- let propertyinfoint = ( typeof< RecordType>) .GetProperty( " fieldstring" )
252- CheckThrowsArgumentException ( fun () -> FSharpValue.GetRecordField( " invalid" , propertyinfoint) |> ignore)
251+ let propertyinfoint = ( typeof< RecordType>) .GetProperty( " fieldstring" ) // null
252+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetRecordField( " invalid" , propertyinfoint) |> ignore)
253253
254254 [<Fact>]
255255 member _.GetStructRecordField () =
@@ -259,15 +259,15 @@ type FSharpValueTests() =
259259 Assert.AreEqual(( FSharpValue.GetRecordField( structRecord1, propertyinfo1)), " field1" )
260260
261261 // null value
262- CheckThrowsArgumentException ( fun () -> FSharpValue.GetRecordField( null , propertyinfo1)|> ignore)
263- CheckThrowsArgumentException ( fun () -> FSharpValue.GetRecordField( () , propertyinfo1)|> ignore)
262+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetRecordField( null , propertyinfo1)|> ignore)
263+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetRecordField( () , propertyinfo1)|> ignore)
264264
265265 // invalid value
266266 CheckThrowsArgumentException( fun () -> FSharpValue.GetRecordField( " invalid" , propertyinfo1) |> ignore)
267267
268268 // invalid property info
269- let propertyinfoint = ( typeof< StructRecordType>) .GetProperty( " fieldstring" )
270- CheckThrowsArgumentException ( fun () -> FSharpValue.GetRecordField( " invalid" , propertyinfoint) |> ignore)
269+ let propertyinfoint = ( typeof< StructRecordType>) .GetProperty( " fieldstring" ) // null
270+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetRecordField( " invalid" , propertyinfoint) |> ignore)
271271
272272 [<Fact>]
273273 member _.GetRecordFields () =
@@ -280,8 +280,8 @@ type FSharpValueTests() =
280280 Assert.AreEqual(( FSharpValue.GetRecordFields( genericRecordType1)).[ 0 ], " field1" )
281281
282282 // null value
283- CheckThrowsArgumentException ( fun () -> FSharpValue.GetRecordFields( null )|> ignore)
284- CheckThrowsArgumentException ( fun () -> FSharpValue.GetRecordFields( () )|> ignore)
283+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetRecordFields( null )|> ignore)
284+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetRecordFields( () )|> ignore)
285285
286286 // invalid value
287287 CheckThrowsArgumentException( fun () -> FSharpValue.GetRecordFields( " invalid" ) |> ignore)
@@ -300,8 +300,8 @@ type FSharpValueTests() =
300300 Assert.AreEqual( FSharpValue.GetTupleField( tuple2, 1 ), " tuple2" )
301301
302302 // null value
303- CheckThrowsArgumentException ( fun () -> FSharpValue.GetTupleField( null , 3 )|> ignore)
304- CheckThrowsArgumentException ( fun () -> FSharpValue.GetTupleField( () , 3 )|> ignore)
303+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetTupleField( null , 3 )|> ignore)
304+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetTupleField( () , 3 )|> ignore)
305305
306306 // invalid value
307307 CheckThrowsArgumentException( fun () -> FSharpValue.GetTupleField( " Invalid" , 3 )|> ignore)
@@ -329,8 +329,8 @@ type FSharpValueTests() =
329329 Assert.AreEqual( ( FSharpValue.GetTupleFields( tuple2)).[ 1 ], " tuple2" )
330330
331331 // null value
332- CheckThrowsArgumentException ( fun () -> FSharpValue.GetTupleFields( null )|> ignore)
333- CheckThrowsArgumentException ( fun () -> FSharpValue.GetTupleFields( () )|> ignore)
332+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetTupleFields( null )|> ignore)
333+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.GetTupleFields( () )|> ignore)
334334
335335 // invalid value
336336 CheckThrowsArgumentException( fun () -> FSharpValue.GetTupleFields( " Invalid" )|> ignore)
@@ -393,7 +393,7 @@ type FSharpValueTests() =
393393 Assert.AreEqual( FSharpValue.GetRecordFields( makeRecordGeneric).[ 0 ], " field1" )
394394
395395 // null value
396- CheckThrowsArgumentException ( fun () -> FSharpValue.MakeRecord( null , null )|> ignore)
396+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.MakeRecord( null , null )|> ignore)
397397
398398 // invalid value
399399 CheckThrowsArgumentException( fun () -> FSharpValue.MakeRecord( typeof< GenericRecordType< string, int>>, [| box 1 ; box( " invalid param" ); box( " invalid param" ) |])|> ignore)
@@ -471,7 +471,7 @@ type FSharpValueTests() =
471471 Assert.AreEqual( ( unbox< GenericRecordType< string, int>>( resultGenericRecordType)) .field1, genericRecordType1.field1)
472472
473473 // null value
474- CheckThrowsArgumentException ( fun () -> FSharpValue.PreComputeRecordConstructor( null )|> ignore)
474+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.PreComputeRecordConstructor( null )|> ignore)
475475
476476 // invalid value
477477 CheckThrowsArgumentException( fun () -> FSharpValue.PreComputeRecordConstructor( typeof< DiscUnionType< string>>) |> ignore)
@@ -495,7 +495,7 @@ type FSharpValueTests() =
495495 Assert.AreEqual( genericrecordCtorInfo.ReflectedType, typeof< GenericRecordType< string, int>>)
496496
497497 // null value
498- CheckThrowsArgumentException ( fun () -> FSharpValue.PreComputeRecordConstructorInfo( null )|> ignore)
498+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.PreComputeRecordConstructorInfo( null )|> ignore)
499499
500500 // invalid value
501501 CheckThrowsArgumentException( fun () -> FSharpValue.PreComputeRecordConstructorInfo( typeof< DiscUnionType< string>>) |> ignore)
@@ -517,7 +517,7 @@ type FSharpValueTests() =
517517 Assert.AreEqual( recordFieldReader( genericRecordType1), box( " field1" ))
518518
519519 // null value
520- CheckThrowsArgumentException ( fun () -> FSharpValue.PreComputeRecordFieldReader( null )|> ignore)
520+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.PreComputeRecordFieldReader( null )|> ignore)
521521
522522 [<Fact>]
523523 member _.PreComputeStructRecordFieldReader () =
@@ -536,7 +536,7 @@ type FSharpValueTests() =
536536 Assert.AreEqual( ( genericrecordReader( genericRecordType1)).[ 0 ], " field1" )
537537
538538 // null value
539- CheckThrowsArgumentException ( fun () -> FSharpValue.PreComputeRecordReader( null )|> ignore)
539+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.PreComputeRecordReader( null )|> ignore)
540540
541541 // invalid value
542542 CheckThrowsArgumentException( fun () -> FSharpValue.PreComputeRecordReader( typeof< DiscUnionType< string>>) |> ignore)
@@ -566,7 +566,7 @@ type FSharpValueTests() =
566566 Assert.AreEqual( tupleNestedCtor([| box 1 ; box( 2 , " tuple" ) |] ), box( tuple3))
567567
568568 // null value
569- CheckThrowsArgumentException ( fun () -> FSharpValue.PreComputeTupleConstructor( null )|> ignore)
569+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.PreComputeTupleConstructor( null )|> ignore)
570570
571571 // invalid value
572572 CheckThrowsArgumentException( fun () -> FSharpValue.PreComputeTupleConstructor( typeof< DiscUnionType< string>>) |> ignore)
@@ -604,7 +604,7 @@ type FSharpValueTests() =
604604 Assert.AreEqual( nestedTupleCtorInfo.ReflectedType, typeof< Tuple< int, Tuple< int, string>>>)
605605
606606 // null value
607- CheckThrowsArgumentException ( fun () -> FSharpValue.PreComputeTupleConstructorInfo( null )|> ignore)
607+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.PreComputeTupleConstructorInfo( null )|> ignore)
608608
609609 // invalid value
610610 CheckThrowsArgumentException( fun () -> FSharpValue.PreComputeTupleConstructorInfo( typeof< RecordType>) |> ignore)
@@ -634,7 +634,7 @@ type FSharpValueTests() =
634634 Assert.AreEqual( tupleNestedPropInfo.PropertyType, typeof< Tuple< int, string>>)
635635
636636 // null value
637- CheckThrowsArgumentException ( fun () -> FSharpValue.PreComputeTuplePropertyInfo( null , 0 )|> ignore)
637+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.PreComputeTuplePropertyInfo( null , 0 )|> ignore)
638638
639639 // invalid value
640640 CheckThrowsArgumentException( fun () -> FSharpValue.PreComputeTuplePropertyInfo( typeof< RecordType>, 0 ) |> ignore)
@@ -670,7 +670,7 @@ type FSharpValueTests() =
670670 Assert.AreEqual ( longTupleReader longTuple, [| box ( " yup" , 1 s); box 2 ; box 3 ; box 4 ; box 5 ; box 6 ; box 7 ; box 8 ; box 9 ; box 10 ; box 11 ; box ( Some 12 ); box 13 ; box " nope" ; box ( struct ( 15 , 16 )); box 17 ; box 18 ; box ( ValueSome 19 ) |])
671671
672672 // null value
673- CheckThrowsArgumentException ( fun () -> FSharpValue.PreComputeTupleReader( null )|> ignore)
673+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.PreComputeTupleReader( null )|> ignore)
674674
675675 // invalid value
676676 CheckThrowsArgumentException( fun () -> FSharpValue.PreComputeTupleReader( typeof< RecordType>) |> ignore)
@@ -813,7 +813,7 @@ type FSharpValueTests() =
813813 Assert.AreEqual( discUnionMemberInfo.ReflectedType, typeof< DiscUnionType< int>>)
814814
815815 // null value
816- CheckThrowsArgumentException ( fun () -> FSharpValue.PreComputeUnionTagMemberInfo( null )|> ignore)
816+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.PreComputeUnionTagMemberInfo( null )|> ignore)
817817
818818 // invalid value
819819 CheckThrowsArgumentException( fun () -> FSharpValue.PreComputeUnionTagMemberInfo( typeof< RecordType>) |> ignore)
@@ -851,7 +851,7 @@ type FSharpValueTests() =
851851 Assert.AreEqual( voptionTagReader( box( voptionNone)), 0 )
852852
853853 // null value
854- CheckThrowsArgumentException ( fun () -> FSharpValue.PreComputeUnionTagReader( null )|> ignore)
854+ CheckThrowsArgumentNullException ( fun () -> FSharpValue.PreComputeUnionTagReader( null )|> ignore)
855855
856856 // invalid value
857857 CheckThrowsArgumentException( fun () -> FSharpValue.PreComputeUnionTagReader( typeof< RecordType>) |> ignore)
@@ -1179,7 +1179,7 @@ type FSharpTypeTests() =
11791179
11801180 // invalid cases
11811181 CheckThrowsArgumentException( fun () -> FSharpType.MakeStructTupleType( [| null ; null |]) |> ignore )
1182- CheckThrowsArgumentException ( fun () -> FSharpType.MakeStructTupleType( null ) |> ignore )
1182+ CheckThrowsArgumentNullException ( fun () -> FSharpType.MakeStructTupleType( null ) |> ignore )
11831183 CheckThrowsArgumentException( fun () -> FSharpType.MakeStructTupleType( [| |]) |> ignore )
11841184
11851185type UnionCaseInfoTests () =
0 commit comments