Esempio n. 1
0
 public static void batchDetailsType(batchDetailsType request)
 {
     if (null != request)
     {
         if (DateTime.MinValue != request.settlementTimeUTC)
         {
             request.settlementTimeUTCSpecified = true;
         }
         if (DateTime.MinValue != request.settlementTimeLocal)
         {
             request.settlementTimeLocalSpecified = true;
         }
     }
 }
Esempio n. 2
0
        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);
        }