public virtual ApiSaleServerRequestModel MapServerResponseToRequest(
            ApiSaleServerResponseModel response)
        {
            var request = new ApiSaleServerRequestModel();

            request.SetProperties(
                response.Amount,
                response.CutomerId,
                response.Note,
                response.PetId,
                response.SaleDate,
                response.SalesPersonId);
            return(request);
        }
예제 #2
0
        public void MapModelToEntity()
        {
            var mapper = new DALSaleMapper();
            ApiSaleServerRequestModel model = new ApiSaleServerRequestModel();

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

            response.Amount.Should().Be(1m);
            response.CutomerId.Should().Be(1);
            response.Note.Should().Be("A");
            response.PetId.Should().Be(1);
            response.SaleDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.SalesPersonId.Should().Be(1);
        }