コード例 #1
0
        public virtual ApiTransactionServerRequestModel MapServerResponseToRequest(
            ApiTransactionServerResponseModel response)
        {
            var request = new ApiTransactionServerRequestModel();

            request.SetProperties(
                response.Amount,
                response.GatewayConfirmationNumber,
                response.TransactionStatusId);
            return(request);
        }
コード例 #2
0
        public void MapModelToEntity()
        {
            var mapper = new DALTransactionMapper();
            ApiTransactionServerRequestModel model = new ApiTransactionServerRequestModel();

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

            response.Amount.Should().Be(1m);
            response.GatewayConfirmationNumber.Should().Be("A");
            response.TransactionStatusId.Should().Be(1);
        }