public static void transactionSummaryType(transactionSummaryType request) { if (null != request) { if (request.hasReturnedItems) { request.hasReturnedItemsSpecified = true; } } }
public void MockgetUnsettledTransactionListTest() { //define all mocked objects as final var mockController = GetMockController<getUnsettledTransactionListRequest, getUnsettledTransactionListResponse>(); var mockRequest = new getUnsettledTransactionListRequest { merchantAuthentication = new merchantAuthenticationType {name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey}, }; var transactionSummaryType = new transactionSummaryType[] { new transactionSummaryType { accountNumber = "1234", } }; var mockResponse = new getUnsettledTransactionListResponse { refId = "1234", sessionToken = "sessiontoken", transactions = transactionSummaryType, }; var errorResponse = new ANetApiResponse(); var results = new List<String>(); const messageTypeEnum messageTypeOk = messageTypeEnum.Ok; SetMockControllerExpectations<getUnsettledTransactionListRequest, getUnsettledTransactionListResponse, getUnsettledTransactionListController>( 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.transactions); LogHelper.info(Logger, "getUnsettledTransactionList: Details:{0}", controllerResponse.transactions); }
public static void transactionSummaryType(transactionSummaryType argument) { if (null != argument) { subscriptionPaymentType(argument.subscription); if (argument.hasReturnedItems) { argument.hasReturnedItemsSpecified = true; } } }