public virtual CountryRequirement MapBOToEF(
            BOCountryRequirement bo)
        {
            CountryRequirement efCountryRequirement = new CountryRequirement();

            efCountryRequirement.SetProperties(
                bo.CountryId,
                bo.Details,
                bo.Id);
            return(efCountryRequirement);
        }
        public void MapEntityToModel()
        {
            var mapper = new DALCountryRequirementMapper();
            CountryRequirement item = new CountryRequirement();

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

            response.CountryId.Should().Be(1);
            response.Details.Should().Be("A");
            response.Id.Should().Be(1);
        }
        public void MapEFToBO()
        {
            var mapper = new DALCountryRequirementMapper();
            CountryRequirement entity = new CountryRequirement();

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

            BOCountryRequirement response = mapper.MapEFToBO(entity);

            response.CountryId.Should().Be(1);
            response.Detail.Should().Be("A");
            response.Id.Should().Be(1);
        }
Exemple #4
0
        public virtual CountryRequirement MapModelToEntity(
            int id,
            ApiCountryRequirementServerRequestModel model
            )
        {
            CountryRequirement item = new CountryRequirement();

            item.SetProperties(
                id,
                model.CountryId,
                model.Details);
            return(item);
        }
        public void MapEntityToModelList()
        {
            var mapper = new DALCountryRequirementMapper();
            CountryRequirement item = new CountryRequirement();

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

            response.Count.Should().Be(1);
        }
        public void MapEFToBOList()
        {
            var mapper = new DALCountryRequirementMapper();
            CountryRequirement entity = new CountryRequirement();

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

            List <BOCountryRequirement> response = mapper.MapEFToBO(new List <CountryRequirement>()
            {
                entity
            });

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