BO4ETestProject/TestAbstractDeserialization.cs
/// <summary>
///     Tests Abstract Deserialization using Newtonsoft.Json
/// </summary>
/// <seealso cref="TestAbstractDeserializationSystemText" />
Tests Abstract Deserialization using Newtonsoft.Json
Tests Abstract Deserialization using Newtonsoft . Json
[TestMethod]
        public void TestMaLoDeserializationNewtonsoft()
        {
            JObject json;
            using (var r = new StreamReader("BoMapperTests/marktlokation_simple.json"))
            {
                var jsonString = r.ReadToEnd();
                json = JObject.Parse(jsonString);
            }
            var maloString = json["input"].ToString();
            var malo = JsonConvert.DeserializeObject<Marktlokation>(maloString);
            Assert.IsNotNull(malo);
            var bo = JsonConvert.DeserializeObject<BusinessObject>(maloString);
            Assert.IsNotNull(bo);
            Assert.IsInstanceOfType(bo, typeof(Marktlokation));
        }
[ TestMethod ] public void TestMaLoDeserializationNewtonsoft ( ) { JObject json ; using ( var r = new StreamReader ( " " ) ) { var jsonString = r . ReadToEnd ( ) ; json = JObject . Parse ( jsonString ) ; } var maloString = json [ " " ] . ToString ( ) ; var malo = JsonConvert . DeserializeObject < Marktlokation > ( maloString ) ; Assert . IsNotNull ( malo ) ; var bo = JsonConvert . DeserializeObject < BusinessObject > ( maloString ) ; Assert . IsNotNull ( bo ) ; Assert . IsInstanceOfType ( bo , typeof ( Marktlokation ) ) ; }
Tests Abstract Deserialization using Newtonsoft.Json
Tests Abstract Deserialization using Newtonsoft . Json
seealso
None