1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2026-04-08 10:41:08 +00:00
This commit is contained in:
Jkorf 2026-04-07 16:20:03 +02:00
parent 13ecadd881
commit 7c34b62866
2 changed files with 4 additions and 3 deletions

View File

@ -9,7 +9,7 @@ using System.Text.Json;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace CryptoExchange.Net.UnitTests namespace CryptoExchange.Net.UnitTests.ClientTests
{ {
[TestFixture] [TestFixture]
public class SocketClientTests public class SocketClientTests

View File

@ -98,6 +98,7 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
private static T? _undefinedEnumValue; private static T? _undefinedEnumValue;
private static bool _hasFlagsAttribute = _enumType.IsDefined(typeof(FlagsAttribute)); private static bool _hasFlagsAttribute = _enumType.IsDefined(typeof(FlagsAttribute));
private static ConcurrentBag<string> _unknownValuesWarned = new ConcurrentBag<string>(); private static ConcurrentBag<string> _unknownValuesWarned = new ConcurrentBag<string>();
private static ConcurrentBag<string> _notOptimalValuesWarned = new ConcurrentBag<string>();
internal class NullableEnumConverter : JsonConverter<T?> internal class NullableEnumConverter : JsonConverter<T?>
{ {
@ -210,9 +211,9 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
if (RunOptimistic && !isNumber) 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}"))}]"); LibraryHelpers.StaticLogger?.LogTrace($"Enum mapping sub-optimal. EnumType: {_enumType.FullName}, Value: {stringValue}, Known values: [{string.Join(", ", _mappingToEnum!.Select(m => $"{m.StringValue}: {m.Value}"))}]");
} }
} }