public void GetFieldTests()
        {
            var C1 = typeof(c1);
            var fields = C1.DoGetFields();
            var instance = new c1();

            foreach (var field in fields)
            {
                var get = field.CreateGet();

                var value = get.DynamicInvoke(instance);
                _output.WriteLine($"{field.Name} == {value}");
                // Assert.Equal(prop.Name, value.ToString());
            }

            instance = new c2();

            foreach (var field in fields)
            {
                var get = field.CreateGet();

                var value = get.DynamicInvoke(instance);
                _output.WriteLine($"{field.Name} == {value}");
                // Assert.Equal(prop.Name, value.ToString());
            }

            foreach (var field in fields)
            {
                var get = field.CreateGet<c1>();

                var value = get(instance);
                _output.WriteLine($"{field.Name} == {value}");
                //  Assert.Equal(prop.Name, value.ToString());
            }
        }
Esempio n. 2
0
        public void GetFieldTests()
        {
            var C1       = typeof(c1);
            var fields   = C1.DoGetFields();
            var instance = new c1();

            foreach (var field in fields)
            {
                var get = field.CreateGet();

                var value = get.DynamicInvoke(instance);
                _output.WriteLine($"{field.Name} == {value}");
                // Assert.Equal(prop.Name, value.ToString());
            }

            instance = new c2();

            foreach (var field in fields)
            {
                var get = field.CreateGet();

                var value = get.DynamicInvoke(instance);
                _output.WriteLine($"{field.Name} == {value}");
                // Assert.Equal(prop.Name, value.ToString());
            }

            foreach (var field in fields)
            {
                var get = field.CreateGet <c1>();

                var value = get(instance);
                _output.WriteLine($"{field.Name} == {value}");
                //  Assert.Equal(prop.Name, value.ToString());
            }
        }
Esempio n. 3
0
        public void GetTests()
        {
            var C1       = typeof(c1);
            var props    = C1.DoGetProperties();
            var instance = new c1();

            foreach (var prop in props)
            {
                var get = prop.CreateGet();

                var value = get.DynamicInvoke(instance);
                _output.WriteLine($"{prop.Name} == {value}");
                Assert.Equal(prop.Name, value.ToString());
            }

            instance = new c2();

            foreach (var prop in props)
            {
                var get = prop.CreateGet();

                var value = get.DynamicInvoke(instance);
                _output.WriteLine($"{prop.Name} == {value}");
                Assert.Equal(prop.Name, value.ToString());
            }

            foreach (var prop in props)
            {
                var get = prop.CreateGet <c1>();

                var value = get(instance);
                _output.WriteLine($"{prop.Name} == {value}");
                Assert.Equal(prop.Name, value.ToString());
            }
        }
        public void GetTests()
        {
            var C1 = typeof(c1);
            var props = C1.DoGetProperties();
            var instance = new c1();

            foreach (var prop in props)
            {
                var get = prop.CreateGet();
                
                var value = get.DynamicInvoke(instance);
                _output.WriteLine($"{prop.Name} == {value}");
                Assert.Equal(prop.Name , value.ToString() );
            }

            instance = new c2();

            foreach (var prop in props)
            {
                var get = prop.CreateGet();

                var value = get.DynamicInvoke(instance);
                _output.WriteLine($"{prop.Name} == {value}");
                Assert.Equal(prop.Name, value.ToString());
            }

            foreach (var prop in props)
            {
                var get = prop.CreateGet<c1>();

                var value = get(instance);
                _output.WriteLine($"{prop.Name} == {value}");
                Assert.Equal(prop.Name, value.ToString());
            }

        }