예제 #1
0
        public void ShouldReturnByConvention()
        {
            var result = BasePropertyPredicateHandler <Source, Target> .GetTargetProperty(typeof(Source).GetProperty(nameof(Source.PropertyUsingConvention)));

            Assert.NotNull(result);
        }
예제 #2
0
        public void ShouldReturnExpectedValueByAttribute()
        {
            var result = BasePropertyPredicateHandler <Source, Target> .GetTargetProperty(typeof(Source).GetProperty(nameof(Source.PropertyUsingAttribute)));

            Assert.Equal(typeof(Target).GetProperty(nameof(Target.PropertyUsingAttribute_Suffix)), result);
        }
예제 #3
0
        public void ShouldReturnNullIfPropertyNotFoundByAttribute()
        {
            var result = BasePropertyPredicateHandler <Source, Target> .GetTargetProperty(typeof(Source).GetProperty(nameof(Source.PropertyUsingAttributeWithoutMatchingTarget)));

            Assert.Null(result);
        }
예제 #4
0
        public void ShouldReturnExpectedValueByConvention()
        {
            var result = BasePropertyPredicateHandler <Source, Target> .GetTargetProperty(typeof(Source).GetProperty(nameof(Source.PropertyUsingConvention)));

            Assert.Equal(typeof(Target).GetProperty(nameof(Target.PropertyUsingConvention)), result);
        }