public void PrivateSetterInGrandGrandparentWorks()
 {
     var source = new Source {ParentProperty = "ParentProperty", ChildProperty = 1};
     var target = Mapper.Map<Source, GrandGrandChildPrivate>(source);
     target.ParentProperty.ShouldBe(source.ParentProperty);
     target.ChildProperty.ShouldBe(source.ChildProperty);
 }
 public void PublicSetterInParentWorks()
 {
     var source = new Source {ParentProperty = "ParentProperty", ChildProperty = 1};
     var target = Mapper.Map<Source, Child>(source);
     target.ParentProperty.ShouldBe(source.ParentProperty);
     target.ChildProperty.ShouldBe(source.ChildProperty);
 }
예제 #3
0
        public void Should_map_over_constructor()
        {
            var source = new Source { Value = "value" };

            var dest = Mapper.Map<Destination>(source);

            dest.Value.ShouldBe(source.Value);
        }
예제 #4
0
 protected override void Because_of()
 {
     var source = new Source
     {
         Number = 23
     };
     _destination = Mapper.Map<Source, Destination>(source);
 }
 protected override void Because_of()
 {
     _source = Mapper.Map<Destination, Source>(new Destination
     {
         UserId = SomeId
     });
     _destination = Mapper.Map<Source, Destination>(new Source
     {
         AccountId = SomeOtherId
     });
 }
예제 #6
0
 protected override void Because_of()
 {
     var source = new Source()
     {
         Id = 1,
         ListProperty = _sourceList,
     };
     _destination = new Destination()
     {
         Id = 2,
         ListProperty = new List<int>() { 4, 5, 6 }.Where(a => true).ToArray()
     };
     _destination = Mapper.Map<Source, Destination>(source, _destination);
 }
        protected override void Because_of()
        {
            Source source = new Source();

            _destination = Mapper.Map<Source, Destination>(source);
        }