@@ -59,7 +59,7 @@ public void Aes_Encrypt_ErrorKey_Fail_Test()
5959 var srcString = "test aes encrypt" ;
6060
6161 //Assert
62- Assert . Throws < ArgumentOutOfRangeException > ( ( ) => EncryptProvider . AESEncrypt ( srcString , key ) ) ;
62+ Assert . Throws < ArgumentException > ( ( ) => EncryptProvider . AESEncrypt ( srcString , key ) ) ;
6363 }
6464
6565 [ Fact ( DisplayName = "AES decrypt success test" ) ]
@@ -99,7 +99,7 @@ public void Aes_Decrypt_ErrorKey_Fail_Test()
9999 var srcString = "test aes encrypt" ;
100100
101101 //Assert
102- Assert . Throws < ArgumentOutOfRangeException > ( ( ) => EncryptProvider . AESDecrypt ( srcString , key ) ) ;
102+ Assert . Throws < ArgumentException > ( ( ) => EncryptProvider . AESDecrypt ( srcString , key ) ) ;
103103 }
104104
105105 [ Fact ( DisplayName = "AES encrypt with iv success test" ) ]
@@ -130,7 +130,7 @@ public void Aes_Encrypt_With_ErrorKey_Fail_Test()
130130 var srcString = "test aes encrypt" ;
131131
132132 //Assert
133- Assert . Throws < ArgumentOutOfRangeException > ( ( ) => EncryptProvider . AESEncrypt ( srcString , key , iv ) ) ;
133+ Assert . Throws < ArgumentException > ( ( ) => EncryptProvider . AESEncrypt ( srcString , key , iv ) ) ;
134134 }
135135
136136 [ Fact ( DisplayName = "AES encrypt with error iv test" ) ]
@@ -143,7 +143,7 @@ public void Aes_Encrypt_With_ErrorIV_Fail_Test()
143143
144144 var srcString = "test aes encrypt" ;
145145 //Assert
146- Assert . Throws < ArgumentOutOfRangeException > ( ( ) => EncryptProvider . AESEncrypt ( srcString , key , iv ) ) ;
146+ Assert . Throws < ArgumentException > ( ( ) => EncryptProvider . AESEncrypt ( srcString , key , iv ) ) ;
147147 }
148148
149149 [ Fact ( DisplayName = "AES decrypt with iv success test" ) ]
@@ -174,7 +174,7 @@ public void Aes_Decrypt_With_ErrorKey_Fail_Test()
174174 var srcString = "test aes encrypt" ;
175175
176176 //Assert
177- Assert . Throws < ArgumentOutOfRangeException > ( ( ) => EncryptProvider . AESDecrypt ( srcString , key , iv ) ) ;
177+ Assert . Throws < ArgumentException > ( ( ) => EncryptProvider . AESDecrypt ( srcString , key , iv ) ) ;
178178 }
179179
180180 [ Fact ( DisplayName = "AES decrypt with error iv test" ) ]
@@ -186,7 +186,7 @@ public void Aes_Decrypt_With_ErrorIV_Fail_Test()
186186 var srcString = "test aes encrypt" ;
187187
188188 //Assert
189- Assert . Throws < ArgumentOutOfRangeException > ( ( ) => EncryptProvider . AESDecrypt ( srcString , key , iv ) ) ;
189+ Assert . Throws < ArgumentException > ( ( ) => EncryptProvider . AESDecrypt ( srcString , key , iv ) ) ;
190190 }
191191
192192 [ Fact ( DisplayName = "AES encrypt and decrypt about file stream" ) ]
0 commit comments