public void MockgetSettledBatchListTest() { //define all mocked objects as final var mockController = GetMockController<getSettledBatchListRequest, getSettledBatchListResponse>(); var mockRequest = new getSettledBatchListRequest { merchantAuthentication = new merchantAuthenticationType {name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey}, }; var batchDetailsType = new batchDetailsType[] { new batchDetailsType { batchId = "1234", } }; var mockResponse = new getSettledBatchListResponse { refId = "1234", sessionToken = "sessiontoken", batchList = batchDetailsType, }; var errorResponse = new ANetApiResponse(); var results = new List<String>(); const messageTypeEnum messageTypeOk = messageTypeEnum.Ok; SetMockControllerExpectations<getSettledBatchListRequest, getSettledBatchListResponse, getSettledBatchListController>( 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.batchList); LogHelper.info(Logger, "getSettledBatchList: Details:{0}", controllerResponse.batchList); }
public static void getSettledBatchListResponse(getSettledBatchListResponse argument) { if (null != argument) { if (null != argument.batchList) { foreach (var value in argument.batchList) { batchDetailsType(value); } } } }