public void MockdecryptPaymentDataTest() { //define all mocked objects as final var mockController = GetMockController<decryptPaymentDataRequest, decryptPaymentDataResponse>(); var mockRequest = new decryptPaymentDataRequest { merchantAuthentication = new merchantAuthenticationType() {name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey}, }; var mockResponse = new decryptPaymentDataResponse { refId = "1234", sessionToken = "sessiontoken", paymentDetails = new paymentDetails() { amount = "15.50" } }; var errorResponse = new ANetApiResponse(); var results = new List<String>(); const messageTypeEnum messageTypeOk = messageTypeEnum.Ok; SetMockControllerExpectations<decryptPaymentDataRequest, decryptPaymentDataResponse, decryptPaymentDataController>( mockController.MockObject, mockRequest, mockResponse, errorResponse, results, messageTypeOk); mockController.MockObject.Execute(AuthorizeNet.Environment.CUSTOM); //mockController.MockObject.Execute(); // or var controllerResponse = mockController.MockObject.ExecuteWithApiResponse(AuthorizeNet.Environment.CUSTOM); var controllerResponse = mockController.MockObject.GetApiResponse(); Assert.IsNotNull(controllerResponse); Assert.IsNotNull(controllerResponse.paymentDetails); LogHelper.info(Logger, "decryptPaymentData: PaymentDetailsAmount:{0}", controllerResponse.paymentDetails.amount); }
public static void decryptPaymentDataResponse(decryptPaymentDataResponse argument) { if (null != argument) { customerAddressType(argument.shippingInfo); customerAddressType(argument.billingInfo); creditCardMaskedType(argument.cardInfo); paymentDetails(argument.paymentDetails); } }