1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-11 16:32:57 +00:00

Fixed bug in bool converter

This commit is contained in:
Jkorf
2026-06-29 11:20:06 +02:00
parent f4736bcf49
commit dd1cefdc90
2 changed files with 12 additions and 1 deletions
@@ -25,6 +25,17 @@ namespace CryptoExchange.Net.UnitTests.ConverterTests
Assert.That(output!.Value == expected);
}
[TestCase(1, true)]
[TestCase(2, true)]
[TestCase(0, false)]
[TestCase(-1, false)]
public void TestBoolConverterInts(int value, bool? expected)
{
var val = value == null ? "null" : $"{value}";
var output = JsonSerializer.Deserialize<STJBoolObject>($"{{ \"Value\": {val} }}", SerializerOptions.WithConverters(new TestSerializerContext()));
Assert.That(output!.Value == expected);
}
[TestCase("1", true)]
[TestCase("true", true)]
[TestCase("yes", true)]