-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Fix missing error code to error description mappings for `Crypto…
…Error` (#969) * Update BuildCryptoErrorDescriptions() * Update error message * BUG: Fix `ERR998.ExceptionInAnalyze`: `InvalidOperationException: Unrecognized crypto HRESULT: 0x80096011` for check `BA2022.SignSecurely` when the signature is malformed, by adding missing error code to error description mappings. * Update texts * add InternalsVisibleToAttribute --------- Co-authored-by: Michael C. Fanning <[email protected]>
- Loading branch information
1 parent
0cf0bc8
commit 8dc637e
Showing
4 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
using FluentAssertions; | ||
|
||
using Xunit; | ||
|
||
namespace Microsoft.CodeAnalysis.IL.Rules | ||
{ | ||
public class CryptoErrorEnumTests | ||
{ | ||
[Fact] | ||
public void CryptoErrorEnumTest_NoMissingValues() | ||
{ | ||
IEnumerable<CryptoError> enumValues = Enum.GetValues(typeof(CryptoError)).Cast<CryptoError>(); | ||
Dictionary<CryptoError, string> dictionaryValues = RulesExtensionMethods.BuildCryptoErrorDescriptions(); | ||
var missingValues = enumValues.Where(value => !dictionaryValues.ContainsKey(value)).ToList(); | ||
missingValues.Should().HaveCount(0, "BuildCryptoErrorDescriptions() should contain all cases from CryptoError enum."); | ||
} | ||
} | ||
} |