BO4ETestProject/TestAbstractDeserialization.cs
/// <summary>
///     Tests Abstract Deserialization using System.Text
/// </summary>
/// <seealso cref="TestMaLoDeserializationNewtonsoft" />
Tests Abstract Deserialization using System.Text
Tests Abstract Deserialization using System . Text
[TestMethod]
        public void TestMaLoDeserializationSystemText()
        {
            JsonDocument json;
            using (var r = new StreamReader("BoMapperTests/marktlokation_simple.json"))
            {
                var jsonString = r.ReadToEnd();
                json = JsonDocument.Parse(jsonString);
            }
            var options = LenientParsing.MOST_LENIENT.GetJsonSerializerOptions();
            var maloString = json.RootElement.GetProperty("input").GetRawText();
            Assert.IsNotNull(maloString);
            var malo = JsonSerializer.Deserialize<Marktlokation>(maloString, options);
            Assert.IsNotNull(malo);
            var bo = JsonSerializer.Deserialize<BusinessObject>(maloString, options);
            Assert.IsNotNull(bo);
            Assert.IsInstanceOfType(bo, typeof(Marktlokation));
        }
[ TestMethod ] public void TestMaLoDeserializationSystemText ( ) { JsonDocument json ; using ( var r = new StreamReader ( " " ) ) { var jsonString = r . ReadToEnd ( ) ; json = JsonDocument . Parse ( jsonString ) ; } var options = LenientParsing . MOST_LENIENT . GetJsonSerializerOptions ( ) ; var maloString = json . RootElement . GetProperty ( " " ) . GetRawText ( ) ; Assert . IsNotNull ( maloString ) ; var malo = JsonSerializer . Deserialize < Marktlokation > ( maloString , options ) ; Assert . IsNotNull ( malo ) ; var bo = JsonSerializer . Deserialize < BusinessObject > ( maloString , options ) ; Assert . IsNotNull ( bo ) ; Assert . IsInstanceOfType ( bo , typeof ( Marktlokation ) ) ; }
Tests Abstract Deserialization using System.Text
Tests Abstract Deserialization using System . Text
seealso
None