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

            request.SetProperties(
                response.IpAddress,
                response.Notes,
                response.SaleDate,
                response.TransactionId);
            return(request);
        }
Esempio n. 2
0
        public void MapModelToEntity()
        {
            var mapper = new DALSaleMapper();
            ApiSaleServerRequestModel model = new ApiSaleServerRequestModel();

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

            response.IpAddress.Should().Be("A");
            response.Notes.Should().Be("A");
            response.SaleDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.TransactionId.Should().Be(1);
        }