From 534afa3157ca401ae15502bca154187ee85fdf80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=8D=9A?= Date: Fri, 30 Aug 2019 11:28:14 +0800 Subject: [PATCH] update sign and verify test --- test/NETCore.Encrypt.Tests/RSA_Tests.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/NETCore.Encrypt.Tests/RSA_Tests.cs b/test/NETCore.Encrypt.Tests/RSA_Tests.cs index a73bef0..347c360 100644 --- a/test/NETCore.Encrypt.Tests/RSA_Tests.cs +++ b/test/NETCore.Encrypt.Tests/RSA_Tests.cs @@ -241,6 +241,7 @@ public void Rsa_SignAndVerify_Test() { //Act var rawStr = "123456"; + var rawStr1 = "123457"; var rsaKey = EncryptProvider.CreateRsaKey(); var privateKey = rsaKey.PrivateKey; @@ -249,10 +250,12 @@ public void Rsa_SignAndVerify_Test() var signStr = EncryptProvider.RSASign(rawStr, privateKey); var result = EncryptProvider.RSAVerify(rawStr, signStr, publicKey); + var errorResult = EncryptProvider.RSAVerify(rawStr1, signStr, publicKey); //Assert Assert.NotEmpty(signStr); Assert.True(result); + Assert.False(errorResult); } [Theory(DisplayName = "Rsa to pem test")]