File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -88,14 +88,17 @@ public void BindsDoublesWithoutPrecisionLoss()
8888 Assert . Equal ( 2.0 , result ) ;
8989 }
9090
91- [ Fact ]
92- public void NullToValueType ( )
91+ [ Theory ]
92+ [ InlineData ( 0 , typeof ( int ) ) ]
93+ [ InlineData ( 0d , typeof ( double ) ) ]
94+ [ InlineData ( false , typeof ( bool ) ) ]
95+ public void NullToValueTypeTheory ( object excepectedResult , Type conversionType )
9396 {
9497 var binder = new DefaultBinder ( ) ;
9598
96- Assert . Equal ( 0 , ( int ) binder . Bind ( null , typeof ( int ) ) ) ;
97- Assert . Equal ( 0 , ( double ) binder . Bind ( null , typeof ( double ) ) ) ;
98- Assert . Equal ( false , ( bool ) binder . Bind ( null , typeof ( bool ) ) ) ;
99+ var actualResult = binder . Bind ( null , conversionType ) ;
100+
101+ Assert . Equal ( excepectedResult , actualResult ) ;
99102 }
100103
101104 [ Fact ]
You can’t perform that action at this time.
0 commit comments