Ejemplo n.º 1
0
        public SingleInputMapperTest()
        {
            var resovler = new Mock<IMapperResolver>();
            mapper = new SingleInputMapper(resovler.Object);

            var productMap = new ProductMapBinder();
            var userMap = new UserMapBinder();

            resovler.Setup(x => x.Resolve(typeof (IMapper<BinderModel, ModelProduct>))).Returns(productMap);
            resovler.Setup(x => x.Resolve(typeof (IMapper<BinderModel, ModelUser>))).Returns(userMap);
        }
Ejemplo n.º 2
0
        public DTOModelMapperTest()
        {
            var resolver = new Mock<IMapperResolver>();
            mapper = new SmartMapper<DTO, Model>(resolver.Object);

            var productMap = new ProductMap();
            var userMap = new UserMap();

            resolver.Setup(x => x.Resolve(typeof (IMapper<DTOProduct, Model>))).Returns(productMap);
            resolver.Setup(x => x.Resolve(typeof (IMapper<DTOUser, Model>))).Returns(userMap);
        }