Example #1
0
        public virtual VoteType MapBOToEF(
            BOVoteType bo)
        {
            VoteType efVoteType = new VoteType();

            efVoteType.SetProperties(
                bo.Id,
                bo.Name);
            return(efVoteType);
        }
        public void MapEntityToModel()
        {
            var      mapper = new DALVoteTypeMapper();
            VoteType item   = new VoteType();

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

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
Example #3
0
        public void MapEFToBO()
        {
            var      mapper = new DALVoteTypeMapper();
            VoteType entity = new VoteType();

            entity.SetProperties(1, "A");

            BOVoteType response = mapper.MapEFToBO(entity);

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
Example #4
0
        public virtual VoteType MapModelToEntity(
            int id,
            ApiVoteTypeServerRequestModel model
            )
        {
            VoteType item = new VoteType();

            item.SetProperties(
                id,
                model.Name);
            return(item);
        }
        public void MapEntityToModelList()
        {
            var      mapper = new DALVoteTypeMapper();
            VoteType item   = new VoteType();

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

            response.Count.Should().Be(1);
        }
Example #6
0
        public void MapEFToBOList()
        {
            var      mapper = new DALVoteTypeMapper();
            VoteType entity = new VoteType();

            entity.SetProperties(1, "A");

            List <BOVoteType> response = mapper.MapEFToBO(new List <VoteType>()
            {
                entity
            });

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