예제 #1
0
        public IProfileMapBuilder <TSource, TReceiver> CreateProfile <TSource, TReceiver>()
        {
            var profileMapBuilder = new ProfileMapBuilder <TSource, TReceiver>();

            _profileMapBuilders.Add(profileMapBuilder);

            return(profileMapBuilder);
        }
예제 #2
0
        public void Build_ClassWithoutDefaultConstructor_Throws()
        {
            var subject = new ProfileMapBuilder <FakeSource, ClassWithoutDefaultConstructor>();

            var exception = Assert.Throws <ArgumentException>(() => subject
                                                              .UseAsDefault()
                                                              .For(x => x.Property, x => x.Do(new BlankResolver <FakeSource, string>()))
                                                              .Build());

            Assert.AreEqual($"Default constructor for {nameof(ClassWithoutDefaultConstructor)} not found", exception.Message);
        }