Ejemplo n.º 1
0
        public virtual DeviceAction MapBOToEF(
            BODeviceAction bo)
        {
            DeviceAction efDeviceAction = new DeviceAction();

            efDeviceAction.SetProperties(
                bo.DeviceId,
                bo.Id,
                bo.Name,
                bo.@Value);
            return(efDeviceAction);
        }
Ejemplo n.º 2
0
        public void MapEntityToModelList()
        {
            var          mapper = new DALDeviceActionMapper();
            DeviceAction item   = new DeviceAction();

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

            response.Count.Should().Be(1);
        }
Ejemplo n.º 3
0
        public void MapEntityToModel()
        {
            var          mapper = new DALDeviceActionMapper();
            DeviceAction item   = new DeviceAction();

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

            response.Action.Should().Be("A");
            response.DeviceId.Should().Be(1);
            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
Ejemplo n.º 4
0
        public virtual DeviceAction MapModelToEntity(
            int id,
            ApiDeviceActionServerRequestModel model
            )
        {
            DeviceAction item = new DeviceAction();

            item.SetProperties(
                id,
                model.Action,
                model.DeviceId,
                model.Name);
            return(item);
        }
Ejemplo n.º 5
0
        public void MapEFToBOList()
        {
            var          mapper = new DALDeviceActionMapper();
            DeviceAction entity = new DeviceAction();

            entity.SetProperties(1, 1, "A", "A");

            List <BODeviceAction> response = mapper.MapEFToBO(new List <DeviceAction>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }
Ejemplo n.º 6
0
        public void MapEFToBO()
        {
            var          mapper = new DALDeviceActionMapper();
            DeviceAction entity = new DeviceAction();

            entity.SetProperties(1, 1, "A", "A");

            BODeviceAction response = mapper.MapEFToBO(entity);

            response.DeviceId.Should().Be(1);
            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
            [email protected]().Be("A");
        }