mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2026-04-08 10:41:08 +00:00
wip
This commit is contained in:
parent
13ecadd881
commit
7c34b62866
@ -9,7 +9,7 @@ using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CryptoExchange.Net.UnitTests
|
||||
namespace CryptoExchange.Net.UnitTests.ClientTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class SocketClientTests
|
||||
|
||||
@ -98,6 +98,7 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
|
||||
private static T? _undefinedEnumValue;
|
||||
private static bool _hasFlagsAttribute = _enumType.IsDefined(typeof(FlagsAttribute));
|
||||
private static ConcurrentBag<string> _unknownValuesWarned = new ConcurrentBag<string>();
|
||||
private static ConcurrentBag<string> _notOptimalValuesWarned = new ConcurrentBag<string>();
|
||||
|
||||
internal class NullableEnumConverter : JsonConverter<T?>
|
||||
{
|
||||
@ -210,9 +211,9 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
|
||||
|
||||
if (RunOptimistic && !isNumber)
|
||||
{
|
||||
if (!_unknownValuesWarned.Contains(stringValue))
|
||||
if (!_notOptimalValuesWarned.Contains(stringValue))
|
||||
{
|
||||
_unknownValuesWarned.Add(stringValue!);
|
||||
_notOptimalValuesWarned.Add(stringValue!);
|
||||
LibraryHelpers.StaticLogger?.LogTrace($"Enum mapping sub-optimal. EnumType: {_enumType.FullName}, Value: {stringValue}, Known values: [{string.Join(", ", _mappingToEnum!.Select(m => $"{m.StringValue}: {m.Value}"))}]");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user