public void FromJson_CorrectJsonClass()
        {
            //arrange
            var json      = ExpectedJson;
            var jsonClass = new JsonNullableULongClass();

            //act
            FromJson(jsonClass, json);

            //assert
            Assert.That(jsonClass.Age, Is.EqualTo(42));
            Assert.That(jsonClass.Height, Is.EqualTo(176));
            Assert.That(jsonClass.Min, Is.EqualTo(ulong.MinValue));
            Assert.That(jsonClass.Max, Is.EqualTo(ulong.MaxValue));
            Assert.That(jsonClass.Null, Is.Null);
        }
        public void ToJson_CorrectString()
        {
            //arrange
            var jsonClass = new JsonNullableULongClass()
            {
                Age    = 42,
                Height = 176,
                Max    = ulong.MaxValue,
                Min    = ulong.MinValue,
                Null   = null
            };

            //act
            var json = ToJson(jsonClass);

            //assert
            Assert.That(json.ToString(), Is.EqualTo(ExpectedJson));
        }
 protected abstract ReadOnlySpan <char> FromJson(JsonNullableULongClass value, string json);
 protected abstract string ToJson(JsonNullableULongClass jsonClass);
 protected override ReadOnlySpan <char> FromJson(JsonNullableULongClass value, string json)
 {
     return(Encoding.UTF8.GetString(_convert.FromJson(value, Encoding.UTF8.GetBytes(json))));
 }
        protected override string ToJson(JsonNullableULongClass jsonClass)
        {
            var jsonUtf8 = _convert.ToJsonUtf8(jsonClass);

            return(Encoding.UTF8.GetString(jsonUtf8));
        }
 protected override ReadOnlySpan <char> FromJson(JsonNullableULongClass value, string json)
 {
     return(_convert.FromJson(value, json));
 }
 protected override string ToJson(JsonNullableULongClass jsonClass)
 {
     return(_convert.ToJson(jsonClass).ToString());
 }