I wrote my own BigIntegerConverter for JSON serialization/deserialization.
In the Read method I checked if ValueSequence is used
...
string stringValue;
if (reader.HasValueSequence)
{
stringValue = Encoding.UTF8.GetString(reader.ValueSequence);
}
else
{
stringValue = Encoding.UTF8.GetString(reader.ValueSpan);
}
if (BigInteger.TryParse(stringValue, CultureInfo.InvariantCulture, out var result))
{
return result;
}
...
Now I want to test that code, but I am only able to get to the else tree so far. Based on the documentation I assumed that ValueSequence will be used if the data got big enough.
However, I already testing with BigIntegers as big as BigInteger.Pow(new BigInteger(long.MaxValue), 1234);
and still cannot get the ValueSequence to be used.
Did I missunderstood something?
Is there a way to enforce the use of ValueSqeuence for test purposes?
Regards
Michael