public virtual ApiPetServerRequestModel MapServerResponseToRequest(
            ApiPetServerResponseModel response)
        {
            var request = new ApiPetServerRequestModel();

            request.SetProperties(
                response.AcquiredDate,
                response.BreedId,
                response.Description,
                response.PenId,
                response.Price);
            return(request);
        }
Example #2
0
        public void MapModelToEntity()
        {
            var mapper = new DALPetMapper();
            ApiPetServerRequestModel model = new ApiPetServerRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), 1, "A", 1, 1m);
            Pet response = mapper.MapModelToEntity(1, model);

            response.AcquiredDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.BreedId.Should().Be(1);
            response.Description.Should().Be("A");
            response.PenId.Should().Be(1);
            response.Price.Should().Be(1m);
        }