Exemplo n.º 1
0
        public void MapModelToEntity()
        {
            var mapper = new DALProvinceMapper();
            ApiProvinceServerRequestModel model = new ApiProvinceServerRequestModel();

            model.SetProperties(1, "A");
            Province response = mapper.MapModelToEntity(1, model);

            response.CountryId.Should().Be(1);
            response.Name.Should().Be("A");
        }
Exemplo n.º 2
0
        public void MapEntityToModel()
        {
            var      mapper = new DALProvinceMapper();
            Province item   = new Province();

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

            response.CountryId.Should().Be(1);
            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
Exemplo n.º 3
0
        public void MapEntityToModelList()
        {
            var      mapper = new DALProvinceMapper();
            Province item   = new Province();

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

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