@@ -9,11 +9,14 @@ namespace NETCore.Encrypt.Tests
99 public class RSA_Tests
1010 {
1111
12- [ Fact ( DisplayName = "Create rsa key test" ) ]
13- public void Create_RSAKey_Test ( )
12+ [ Theory ]
13+ [ InlineData ( RsaSize . R2048 ) ]
14+ [ InlineData ( RsaSize . R3072 ) ]
15+ [ InlineData ( RsaSize . R4096 ) ]
16+ public void Create_RSAKey_Test ( RsaSize size )
1417 {
1518 //Act
16- var rsaKey = EncryptProvider . CreateRsaKey ( ) ;
19+ var rsaKey = EncryptProvider . CreateRsaKey ( size ) ;
1720
1821 //Assert
1922 Assert . NotNull ( rsaKey ) ;
@@ -23,10 +26,14 @@ public void Create_RSAKey_Test()
2326 Assert . NotEmpty ( rsaKey . Modulus ) ;
2427 }
2528
26- [ Fact ( DisplayName = "Rsa encrypt success" ) ]
27- public void Rsa_Encrypt_Success_Test ( )
29+ [ Theory ]
30+
31+ [ InlineData ( RsaSize . R2048 ) ]
32+ [ InlineData ( RsaSize . R3072 ) ]
33+ [ InlineData ( RsaSize . R4096 ) ]
34+ public void Rsa_Encrypt_Success_Test ( RsaSize size )
2835 {
29- var rsaKey = EncryptProvider . CreateRsaKey ( ) ;
36+ var rsaKey = EncryptProvider . CreateRsaKey ( size ) ;
3037 var srcString = "rsa encrypt" ;
3138
3239 //Act
@@ -56,10 +63,13 @@ public void Rsa_Encrypt_EmptyData_Test()
5663 Assert . Throws < ArgumentException > ( ( ) => EncryptProvider . RSAEncrypt ( rsaKey . PublicKey , srcString ) ) ;
5764 }
5865
59- [ Fact ( DisplayName = "Rsa decrypt success" ) ]
60- public void Rsa_Decrypt_Success_Test ( )
66+ [ Theory ]
67+ [ InlineData ( RsaSize . R2048 ) ]
68+ [ InlineData ( RsaSize . R3072 ) ]
69+ [ InlineData ( RsaSize . R4096 ) ]
70+ public void Rsa_Decrypt_Success_Test ( RsaSize size )
6171 {
62- var rsaKey = EncryptProvider . CreateRsaKey ( ) ;
72+ var rsaKey = EncryptProvider . CreateRsaKey ( size ) ;
6373 var srcString = "rsa decrypt" ;
6474
6575 //Act
0 commit comments