コード例 #1
0
        void serialized_Type_can_be_used_as_parameter_to_a_function()
        {
            string stringType = typeof(TestClass).FullName ?? throw new InvalidOperationException();
            var    type       = Type.GetType(stringType);
            var    jsonString = GetTestObjectString();

            IFooService component = new FooService();

            dynamic actual = JsonSerializer.Deserialize(jsonString, type);

            var result = component.UseTestClass(actual);

            Assert.True(result == 0);
        }