@@ -41,23 +41,23 @@ public void Encrypt_Decrypt_Stream()
4141
4242 // read encrypted data
4343 media . Position = 0 ;
44- media . Read ( output0 , 0 , 8192 ) ;
45- media . Read ( output1 , 0 , 8192 ) ;
46- media . Read ( output2 , 0 , 8192 ) ;
44+ media . ReadExactly ( output0 , 0 , 8192 ) ;
45+ media . ReadExactly ( output1 , 0 , 8192 ) ;
46+ media . ReadExactly ( output2 , 0 , 8192 ) ;
4747
4848 output0 . All ( x => x == 100 ) . Should ( ) . BeFalse ( ) ;
4949 output1 . All ( x => x == 101 ) . Should ( ) . BeFalse ( ) ;
5050 output2 . All ( x => x == 102 ) . Should ( ) . BeFalse ( ) ;
5151
5252 // read decrypted data
5353 crypto . Position = 0 * 8192 ;
54- crypto . Read ( output0 , 0 , 8192 ) ;
54+ crypto . ReadExactly ( output0 , 0 , 8192 ) ;
5555
5656 crypto . Position = 2 * 8192 ;
57- crypto . Read ( output2 , 0 , 8192 ) ;
57+ crypto . ReadExactly ( output2 , 0 , 8192 ) ;
5858
5959 crypto . Position = 1 * 8192 ;
60- crypto . Read ( output1 , 0 , 8192 ) ;
60+ crypto . ReadExactly ( output1 , 0 , 8192 ) ;
6161
6262 output0 . All ( x => x == 100 ) . Should ( ) . BeTrue ( ) ;
6363 output1 . All ( x => x == 101 ) . Should ( ) . BeTrue ( ) ;
@@ -137,7 +137,7 @@ public void AesStream_Invalid_Password()
137137 . GetValue ( crypto ) as CryptoStream ;
138138
139139 memoryStream . Position = 32 ;
140- cryptoReader . Read ( checkBytes , 0 , checkBytes . Length ) ;
140+ cryptoReader . ReadExactly ( checkBytes , 0 , checkBytes . Length ) ;
141141 Assert . All ( checkBytes , b => Assert . Equal ( 1 , b ) ) ;
142142 }
143143 }
0 commit comments