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

            Assert.NotNull(result);
        }
Exemple #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);
        }
Exemple #3
0
        public void ShouldReturnNullIfPropertyNotFoundByAttribute()
        {
            var result = BasePropertyPredicateHandler <Source, Target> .GetTargetProperty(typeof(Source).GetProperty(nameof(Source.PropertyUsingAttributeWithoutMatchingTarget)));

            Assert.Null(result);
        }
Exemple #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);
        }