コード例 #1
0
        public void SourcePropertyGenerator_Generate()
        {
            // arrange
            PropertyInfo            property   = typeof(GeneratorTestDummy).GetProperties().Single();
            FieldResolverDescriptor descriptor = FieldResolverDescriptor
                                                 .CreateSourceProperty(new FieldReference("Foo", "bar"),
                                                                       property.ReflectedType, property);

            // act
            StringBuilder           source    = new StringBuilder();
            SourcePropertyGenerator generator = new SourcePropertyGenerator();
            string result = generator.Generate("abc", descriptor);

            // assert
            Assert.Equal(Snapshot.Current(), Snapshot.New(result));
        }
コード例 #2
0
        public void SourcePropertyGenerator_Generate()
        {
            // arrange
            var fieldMember = new FieldMember(
                "Foo", "bar",
                GetProperty());

            var descriptor = new SourceResolverDescriptor(fieldMember);

            // act
            var    source    = new StringBuilder();
            var    generator = new SourcePropertyGenerator();
            string result    = generator.Generate("abc", descriptor);

            // assert
            Assert.Equal(Snapshot.Current(), Snapshot.New(result));
        }