Exemple #1
0
        public void MapModelToEntity()
        {
            var mapper = new DALCountryMapper();
            ApiCountryServerRequestModel model = new ApiCountryServerRequestModel();

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

            response.Name.Should().Be("A");
        }
Exemple #2
0
        public void MapEntityToModel()
        {
            var     mapper = new DALCountryMapper();
            Country item   = new Country();

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

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
Exemple #3
0
        public void MapEntityToModelList()
        {
            var     mapper = new DALCountryMapper();
            Country item   = new Country();

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

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