예제 #1
0
        public virtual ApiPetServerRequestModel MapServerResponseToRequest(
            ApiPetServerResponseModel response)
        {
            var request = new ApiPetServerRequestModel();

            request.SetProperties(
                response.BreedId,
                response.ClientId,
                response.Name,
                response.Weight);
            return(request);
        }
예제 #2
0
        public void MapModelToEntity()
        {
            var mapper = new DALPetMapper();
            ApiPetServerRequestModel model = new ApiPetServerRequestModel();

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

            response.BreedId.Should().Be(1);
            response.ClientId.Should().Be(1);
            response.Name.Should().Be("A");
            response.Weight.Should().Be(1);
        }