public virtual ApiCreditCardResponseModel MapBOToModel(
            BOCreditCard boCreditCard)
        {
            var model = new ApiCreditCardResponseModel();

            model.SetProperties(boCreditCard.CreditCardID, boCreditCard.CardNumber, boCreditCard.CardType, boCreditCard.ExpMonth, boCreditCard.ExpYear, boCreditCard.ModifiedDate);

            return(model);
        }
示例#2
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiCreditCardModelMapper();
            var model  = new ApiCreditCardResponseModel();

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

            response.CardNumber.Should().Be("A");
            response.CardType.Should().Be("A");
            response.ExpMonth.Should().Be(1);
            response.ExpYear.Should().Be(1);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }