File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed
Mastercard.Developer.ClientEncryption.Tests/NetCore2/Encryption/JWE Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,34 @@ public class GcmJweObjectTest
1212#if ! NETCOREAPP3_1 && ! NET5_0_OR_GREATER
1313 [ ExpectedException ( typeof ( EncryptionException ) , "AES/GCM/NoPadding is unsupported on .NET Standard < 2.1" ) ]
1414#endif
15- public void TestDecrypt_ShouldReturnDecryptedPayload_WhenPayloadIsGcmEncrypted ( )
15+ public void TestDecrypt_ShouldReturnDecryptedPayload_WhenPayloadIs256GcmEncrypted ( )
1616 {
1717 // GIVEN
18- JweObject jweObject = TestUtils . GetTestGcmJweObject ( ) ;
18+ JweObject jweObject = TestUtils . GetTest256GcmJweObject ( ) ;
19+
20+ // WHEN
21+ string decryptedPayload = jweObject . Decrypt ( TestUtils . GetTestJweConfigBuilder ( ) . Build ( ) ) ;
22+
23+ // THEN
24+ Assert . AreEqual ( "{\" foo\" :\" bar\" }" , decryptedPayload ) ;
25+ }
26+
27+ public void TestDecrypt_ShouldReturnDecryptedPayload_WhenPayloadIs192GcmEncrypted ( )
28+ {
29+ // GIVEN
30+ JweObject jweObject = TestUtils . GetTest192GcmJweObject ( ) ;
31+
32+ // WHEN
33+ string decryptedPayload = jweObject . Decrypt ( TestUtils . GetTestJweConfigBuilder ( ) . Build ( ) ) ;
34+
35+ // THEN
36+ Assert . AreEqual ( "{\" foo\" :\" bar\" }" , decryptedPayload ) ;
37+ }
38+
39+ public void TestDecrypt_ShouldReturnDecryptedPayload_WhenPayloadIs128GcmEncrypted ( )
40+ {
41+ // GIVEN
42+ JweObject jweObject = TestUtils . GetTest128GcmJweObject ( ) ;
1943
2044 // WHEN
2145 string decryptedPayload = jweObject . Decrypt ( TestUtils . GetTestJweConfigBuilder ( ) . Build ( ) ) ;
You can’t perform that action at this time.
0 commit comments