Skip to content

Commit b088db5

Browse files
committed
Updated unit tests / fixes typo issue that resulted in StackOverflow exception
1 parent 9e5df4a commit b088db5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

JwtManager/RsJwt.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ private JwtHeader Header
9494
{
9595
JwtHeader header = new JwtHeader();
9696
header.Set(Helpers.Algorithm.RSA, KeySize);
97-
return Header;
97+
return header;
9898
}
9999
}
100100

101101
private string SignerName
102102
{
103103
get
104104
{
105-
return "SHA" + KeySize.ToString() + "withRSA";
105+
return "SHA" + (int)KeySize + "withRSA";
106106
}
107107
}
108108

JwtManagerTests/RsJwtTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,8 @@ public void SignDataWithInvalidHashAlgorithm()
258258
e = ex;
259259
}
260260

261-
262261
Assert.IsNotNull(e, "An exception should be thrown");
263-
Assert.AreEqual(e.Message, "Signer SHA555WITHRSA not recognised.");
262+
Assert.AreEqual(e.Message, "Invalid values for algorithm or size.");
264263
}
265264

266265
[TestMethod]

0 commit comments

Comments
 (0)