コード例 #1
0
        public void FromJson_CorrectJsonClass()
        {
            //arrange
            var json      = "{\"Aaa\":\"one\",\"Abb\":\"two\",\"Aab\":\"three\"}";
            var jsonClass = new CollisionJsonClass();

            //act
            _convert.FromJson(jsonClass, json);

            //assert
            Assert.That(jsonClass.Aaa, Is.EqualTo("one"));
            Assert.That(jsonClass.Abb, Is.EqualTo("two"));
            Assert.That(jsonClass.Aab, Is.EqualTo("three"));
        }
コード例 #2
0
 protected override ReadOnlySpan <char> FromJson(CollisionJsonClass value, string json)
 {
     return(Encoding.UTF8.GetString(_convert.FromJson(value, Encoding.UTF8.GetBytes(json))));
 }
コード例 #3
0
 protected abstract ReadOnlySpan <char> FromJson(CollisionJsonClass value, string json);
コード例 #4
0
 protected override ReadOnlySpan <char> FromJson(CollisionJsonClass value, string json)
 {
     return(_convert.FromJson(value, json));
 }