コード例 #1
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");
        }
コード例 #2
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);
        }