On Nov 12, 11:49 am, Jimmy Bogard <
jimmy.bog...@gmail.com> wrote:
> Are you trying to make the container instantiate destination objects?
>
>
>
> On Fri, Nov 11, 2011 at 8:56 PM, grumpy <
ap.sha...@gmail.com> wrote:
> > According to author's post in version 2.0
>
>
> > but this test doesnt work, can someone point out whats wrong here ?
>
> > public class Source
> > {
> > public int SomeValue { get; set; }
> > }
>
> > public class Destination
> > {
> > public Destination() { }
>
> > public Destination(bool value)
> > {
> > this.WasCustom = true;
> > }
> > public bool WasCustom { get; private set; }
> > public int SomeValue { get; set; }
> > }
>
> > [TestMethod]
> > public void can_make_servicelocator_work()
> > {
> > Mapper.CreateMap<Source, Destination>();
> > var source = new Source { SomeValue = 100 };
> > var dest = Mapper.Map<Source, Destination>(source,
> > (option) => option.ConstructServicesUsing((t) => new
> > Destination(true)));
> > Assert.IsTrue(dest.WasCustom);
> > }
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "AutoMapper-users" group.
> > To post to this group, send email to
automapp...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
automapper-use...@googlegroups.com.
> > For more options, visit this group at