@@ -39,37 +39,12 @@ public static void EmptyPath_ThrowsArgumentException()
3939 [ Fact ]
4040 public static void NullEncodingParamInCtor_ShouldNotThrowException ( )
4141 {
42- Action ctorParamsStringEncoding = ( ) => new StreamReader ( "" , ( Encoding ) null ) ;
43- var ctorParamsStringEncodingEx = Record . Exception ( ctorParamsStringEncoding ) ;
44- Assert . Null ( ctorParamsStringEncodingEx ) ;
45-
46- Action ctorParamsStringEncodingBool = ( ) => new StreamReader ( "" , ( Encoding ) null , false ) ;
47- var ctorParamsStringEncodingBoolEx = Record . Exception ( ctorParamsStringEncodingBool ) ;
48- Assert . Null ( ctorParamsStringEncodingBoolEx ) ;
49-
50- Action ctorParamsStringEncodingBoolOptions = ( ) => new StreamReader ( "" , ( Encoding ) null , false , new FileStreamOptions ( ) ) ;
51- var ctorParamsStringEncodingBoolOptionsEx = Record . Exception ( ctorParamsStringEncodingBoolOptions ) ;
52- Assert . Null ( ctorParamsStringEncodingBoolOptionsEx ) ;
53-
54- Action ctorParamsStringEncodingBoolInt = ( ) => new StreamReader ( "" , ( Encoding ) null , false , 100 ) ;
55- var ctorParamsStringEncodingBoolIntEx = Record . Exception ( ctorParamsStringEncodingBoolInt ) ;
56- Assert . Null ( ctorParamsStringEncodingBoolIntEx ) ;
57-
58- Action ctorParamStreamEncoding = ( ) => new StreamReader ( new MemoryStream ( ) , null ) ;
59- var ctorParamStreamEncodingEx = Record . Exception ( ctorParamStreamEncoding ) ;
60- Assert . Null ( ctorParamStreamEncodingEx ) ;
61-
62- Action ctorParamStreamEncodingBool = ( ) => new StreamReader ( new MemoryStream ( ) , null , false ) ;
63- var ctorParamStreamEncodingBoolEx = Record . Exception ( ctorParamStreamEncodingBool ) ;
64- Assert . Null ( ctorParamStreamEncodingBoolEx ) ;
65-
66- Action ctorParamStreamEncodingBoolInt = ( ) => new StreamReader ( new MemoryStream ( ) , null , false , 100 ) ;
67- var ctorParamStreamEncodingBoolIntEx = Record . Exception ( ctorParamStreamEncodingBoolInt ) ;
68- Assert . Null ( ctorParamStreamEncodingBoolIntEx ) ;
69-
70- Action ctorParamStreamEncodingBoolIntBool = ( ) => new StreamReader ( new MemoryStream ( ) , null , false , 100 , false ) ;
71- var ctorParamStreamEncodingBoolIntBoolEx = Record . Exception ( ctorParamStreamEncodingBoolIntBool ) ;
72- Assert . Null ( ctorParamStreamEncodingBoolIntBoolEx ) ;
42+ // Call the constructor with overloads that has Stream and null encoding parameters.
43+ // It should not throw exception, to test passing the nullable encoding parameter..
44+ StreamReader streamReaderTest = new StreamReader ( new MemoryStream ( ) , null ) ;
45+ streamReaderTest = new StreamReader ( new MemoryStream ( ) , null , false ) ;
46+ streamReaderTest = new StreamReader ( new MemoryStream ( ) , null , false , 100 ) ;
47+ streamReaderTest = new StreamReader ( new MemoryStream ( ) , null , false , 100 , false ) ;
7348 }
7449
7550 [ Fact ]
0 commit comments