File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -61,5 +61,21 @@ internal async Task CanEncryptDecryptProtectedDataForCurrentUser() {
6161
6262 await CanEncryptDecrypt ( ECryptoMethod . ProtectedDataForCurrentUser ) . ConfigureAwait ( false ) ;
6363 }
64+
65+ [ DataRow ( EHashingMethod . PlainText , TestPassword ) ]
66+ [ DataRow ( EHashingMethod . Pbkdf2 , "WlS48GNrs1hAhcNHPfV09TPTLhf03gExb6zpaKiwX5A=" ) ]
67+ [ DataRow ( EHashingMethod . SCrypt , "9LjhjyugakDQ7Haq/ufyTZDfIGeeWbLcE+/9IeKm8gc=" ) ]
68+ [ TestMethod ]
69+ internal void CanHash ( EHashingMethod hashingMethod , string expectedHash ) {
70+ if ( ! Enum . IsDefined ( hashingMethod ) ) {
71+ throw new InvalidEnumArgumentException ( nameof ( hashingMethod ) , ( int ) hashingMethod , typeof ( EHashingMethod ) ) ;
72+ }
73+
74+ ArgumentException . ThrowIfNullOrEmpty ( expectedHash ) ;
75+
76+ string hashed = Hash ( hashingMethod , TestPassword ) ;
77+
78+ Assert . AreEqual ( expectedHash , hashed ) ;
79+ }
6480}
6581#pragma warning restore CA1812 // False positive, the class is used during MSTest
You can’t perform that action at this time.
0 commit comments