Esempio n. 1
0
        public virtual PostType MapBOToEF(
            BOPostType bo)
        {
            PostType efPostType = new PostType();

            efPostType.SetProperties(
                bo.Id,
                bo.Type);
            return(efPostType);
        }
        public void MapEntityToModel()
        {
            var      mapper = new DALPostTypeMapper();
            PostType item   = new PostType();

            item.SetProperties(1, "A");
            ApiPostTypeServerResponseModel response = mapper.MapEntityToModel(item);

            response.Id.Should().Be(1);
            response.RwType.Should().Be("A");
        }
Esempio n. 3
0
        public virtual PostType MapModelToEntity(
            int id,
            ApiPostTypeServerRequestModel model
            )
        {
            PostType item = new PostType();

            item.SetProperties(
                id,
                model.RwType);
            return(item);
        }
Esempio n. 4
0
        public void MapEFToBO()
        {
            var      mapper = new DALPostTypeMapper();
            PostType entity = new PostType();

            entity.SetProperties(1, "A");

            BOPostType response = mapper.MapEFToBO(entity);

            response.Id.Should().Be(1);
            response.Type.Should().Be("A");
        }
        public void MapEntityToModelList()
        {
            var      mapper = new DALPostTypeMapper();
            PostType item   = new PostType();

            item.SetProperties(1, "A");
            List <ApiPostTypeServerResponseModel> response = mapper.MapEntityToModel(new List <PostType>()
            {
                { item }
            });

            response.Count.Should().Be(1);
        }
Esempio n. 6
0
        public void MapEFToBOList()
        {
            var      mapper = new DALPostTypeMapper();
            PostType entity = new PostType();

            entity.SetProperties(1, "A");

            List <BOPostType> response = mapper.MapEFToBO(new List <PostType>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }