Skip to content

Commit 18c44c2

Browse files
authored
add MD5 test with length.
1 parent 1eabf1c commit 18c44c2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/NETCore.Encrypt.Tests/MD5_Tests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,16 @@ public void MD5_Error_Test()
2525
{
2626
Assert.Throws<ArgumentException>(() => EncryptProvider.Md5(string.Empty));
2727
}
28+
29+
[Fact(DisplayName = "MD5 with length success test")]
30+
public void MD5_With_Length_Success_Test()
31+
{
32+
var srcString = "Md5 test";
33+
34+
var hashed = EncryptProvider.Md5(srcString, MD5Length.L16);
35+
36+
Assert.NotEmpty(hashed);
37+
Assert.Equal("69c6ecadb32f5492", hashed.ToLower());
38+
}
2839
}
2940
}

0 commit comments

Comments
 (0)