mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
Move Debug assertion to just be a test
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using Bit.Core.Utilities;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Utilities;
|
||||
using Xunit;
|
||||
|
||||
namespace Bit.Core.Test.Utilities;
|
||||
@ -69,4 +70,18 @@ public class EncryptedStringAttributeTests
|
||||
|
||||
Assert.False(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EncryptionTypeMap_HasEntry_ForEachEnumValue()
|
||||
{
|
||||
var enumValues = Enum.GetValues<EncryptionType>();
|
||||
Assert.Equal(enumValues.Length, EncryptedStringAttribute._encryptionTypeMap.Count);
|
||||
|
||||
foreach (var enumValue in enumValues)
|
||||
{
|
||||
// Go a step further and ensure that the map contains a value for each value instead of just casting
|
||||
// a random number for one of the keys.
|
||||
Assert.True(EncryptedStringAttribute._encryptionTypeMap.ContainsKey(enumValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user