예제 #1
0
        public void MapModelToEntity()
        {
            var mapper = new DALPenMapper();
            ApiPenServerRequestModel model = new ApiPenServerRequestModel();

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

            response.Name.Should().Be("A");
        }
예제 #2
0
        public void MapEntityToModel()
        {
            var mapper = new DALPenMapper();
            Pen item   = new Pen();

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

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
예제 #3
0
        public void MapEntityToModelList()
        {
            var mapper = new DALPenMapper();
            Pen item   = new Pen();

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

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