示例#1
0
        public void CanApply_MatchingSourceAndTargetTypes_ReturnsTrue()
        {
            var propertyMapping =
                new PropertyMapping <Source, Target, string>(string.Empty, t => t.TargetValue,
                                                             (s, t) => t.TargetValue = s.SourceValue,
                                                             string.Empty);

            propertyMapping.CanApply(new Source(), new Target()).Should().BeTrue();
        }
示例#2
0
        public void CanApply_MismatchingTargetType_ReturnsFalse()
        {
            var propertyMapping =
                new PropertyMapping <Source, Target, string>(string.Empty, t => t.TargetValue,
                                                             (s, t) => t.TargetValue = s.SourceValue,
                                                             string.Empty);

            propertyMapping.CanApply(new Source(), new object()).Should().BeFalse();
        }
示例#3
0
        public void CanApply_MismatchingSourceType_ReturnsFalse()
        {
            var propertyMapping =
                new PropertyMapping <Source, Target, string>("", t => t.TargetValue,
                                                             (s, t) => t.TargetValue = s.SourceValue,
                                                             "");

            propertyMapping.CanApply(new object(), new Target());
        }