Пример #1
0
        public virtual TicketStatus MapBOToEF(
            BOTicketStatus bo)
        {
            TicketStatus efTicketStatus = new TicketStatus();

            efTicketStatus.SetProperties(
                bo.Id,
                bo.Name);
            return(efTicketStatus);
        }
        public void MapEntityToModel()
        {
            var          mapper = new DALTicketStatusMapper();
            TicketStatus item   = new TicketStatus();

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

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
Пример #3
0
        public virtual TicketStatus MapModelToEntity(
            int id,
            ApiTicketStatusServerRequestModel model
            )
        {
            TicketStatus item = new TicketStatus();

            item.SetProperties(
                id,
                model.Name);
            return(item);
        }
Пример #4
0
        public void MapEFToBO()
        {
            var          mapper = new DALTicketStatusMapper();
            TicketStatus entity = new TicketStatus();

            entity.SetProperties(1, "A");

            BOTicketStatus response = mapper.MapEFToBO(entity);

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
        public void MapEntityToModelList()
        {
            var          mapper = new DALTicketStatusMapper();
            TicketStatus item   = new TicketStatus();

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

            response.Count.Should().Be(1);
        }
Пример #6
0
        public void MapEFToBOList()
        {
            var          mapper = new DALTicketStatusMapper();
            TicketStatus entity = new TicketStatus();

            entity.SetProperties(1, "A");

            List <BOTicketStatus> response = mapper.MapEFToBO(new List <TicketStatus>()
            {
                entity
            });

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