コード例 #1
0
        public void GetDestinationType_WithoutServiceConstructor()
        {
            var mapper = new MapperConfiguration <ClassSource, ClassDest>("sourceTest");
            var actual = mapper.GetDestinationType();

            Assert.AreEqual(actual, typeof(ClassDest));
        }
コード例 #2
0
        public void GetDestinationType_WithoutServiceConstructor()
        {
            MapperConfiguration <ClassSource, ClassDest> mapper = new MapperConfiguration <ClassSource, ClassDest>("sourceTest");
            Type actual = mapper.GetDestinationType();

            Assert.IsType <ClassDest>(actual);
        }
コード例 #3
0
        public void GetDestinationType_WithoutServiceConstructor()
        {
            Type actual = null;
            var mapper = new MapperConfiguration<ClassSource, ClassDest>("sourceTest");
            actual = mapper.GetDestinationType();

            Assert.AreEqual(actual, typeof(ClassDest));
        }
コード例 #4
0
        public void GetDestinationType_WithServiceConstructor()
        {
            ExpressionMapper.ConstructServicesUsing((x) => new ClassDest2());

            MapperConfiguration <ClassSource2, IClassDest2> mapper = ExpressionMapper.CreateMap <ClassSource2, IClassDest2>().ConstructUsingServiceLocator();

            ExpressionMapper.Initialize();
            Type actual = mapper.GetDestinationType();

            Assert.IsType <ClassDest2>(actual);
            ExpressionMapper.Reset();
        }