コード例 #1
0
        public void MapModelToBO()
        {
            var mapper = new BOLProvinceMapper();
            ApiProvinceRequestModel model = new ApiProvinceRequestModel();

            model.SetProperties(1, "A");
            BOProvince response = mapper.MapModelToBO(1, model);

            response.CountryId.Should().Be(1);
            response.Name.Should().Be("A");
        }
コード例 #2
0
        public void MapBOToModel()
        {
            var        mapper = new BOLProvinceMapper();
            BOProvince bo     = new BOProvince();

            bo.SetProperties(1, 1, "A");
            ApiProvinceResponseModel response = mapper.MapBOToModel(bo);

            response.CountryId.Should().Be(1);
            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
コード例 #3
0
        public void MapBOToModelList()
        {
            var        mapper = new BOLProvinceMapper();
            BOProvince bo     = new BOProvince();

            bo.SetProperties(1, 1, "A");
            List <ApiProvinceResponseModel> response = mapper.MapBOToModel(new List <BOProvince>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
コード例 #4
0
        public void MapEFToBO()
        {
            var      mapper = new DALProvinceMapper();
            Province entity = new Province();

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

            BOProvince response = mapper.MapEFToBO(entity);

            response.CountryId.Should().Be(1);
            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
コード例 #5
0
        public void MapBOToEF()
        {
            var mapper = new DALProvinceMapper();
            var bo     = new BOProvince();

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

            Province response = mapper.MapBOToEF(bo);

            response.CountryId.Should().Be(1);
            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }