Skip to content

Commit

Permalink
Update RSAlgorithmTests.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
abatishchev authored Jun 20, 2022
1 parent 26670f6 commit 623a6ad
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/JWT.Tests.Common/Algorithms/RSAlgorithmTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ namespace JWT.Tests.Algorithms
[TestClass]
public class RSAlgorithmTests
{
private static RSACryptoServiceProvider RSACryptoServiceProvider => new();

[DynamicData(nameof(GetFactoryWithPublicPrivateKey), DynamicDataSourceType.Method)]
[DataTestMethod]
public void Ctor_Should_Throw_Exception_When_PublicKey_Is_Null(Func<RSA, RSA, RSAlgorithm> algFactory)
{
var privateKey = RSACryptoServiceProvider;
var privateKey = new RSACryptoServiceProvider();

Action action = () => algFactory(null, privateKey);

Expand All @@ -30,7 +28,7 @@ public void Ctor_Should_Throw_Exception_When_PublicKey_Is_Null(Func<RSA, RSA, RS
[DataTestMethod]
public void Ctor_Should_Throw_Exception_When_PrivateKey_Is_Null(Func<RSA, RSA, RSAlgorithm> algFactory)
{
var publicKey = RSACryptoServiceProvider;
var publicKey = new RSACryptoServiceProvider();

Action action = () => algFactory(publicKey, null);

Expand All @@ -42,7 +40,7 @@ public void Ctor_Should_Throw_Exception_When_PrivateKey_Is_Null(Func<RSA, RSA, R
[DataTestMethod]
public void Sign_Should_Throw_Exception_When_PrivateKey_Is_Null(Func<RSA, RSAlgorithm> algFactory)
{
var publicKey = RSACryptoServiceProvider;
var publicKey = new RSACryptoServiceProvider();
var alg = algFactory(publicKey);

var bytesToSign = Array.Empty<byte>();
Expand Down

0 comments on commit 623a6ad

Please sign in to comment.