コード例 #1
0
	    public void MockgetCustomerProfileIdsTest()
	    {
		    //define all mocked objects as final
            var mockController = GetMockController<getCustomerProfileIdsRequest, getCustomerProfileIdsResponse>();
            var mockRequest = new getCustomerProfileIdsRequest
                {
                    merchantAuthentication = new merchantAuthenticationType {name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey},
                };
            var mockResponse = new getCustomerProfileIdsResponse
                {
                    refId = "1234",
                    sessionToken = "sessiontoken",
                    ids = new [] {"1234"},
                };

		    var errorResponse = new ANetApiResponse();
		    var results = new List<String>();
            const messageTypeEnum messageTypeOk = messageTypeEnum.Ok;

            SetMockControllerExpectations<getCustomerProfileIdsRequest, getCustomerProfileIdsResponse, getCustomerProfileIdsController>(
                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.ids);
            LogHelper.info(Logger, "getCustomerProfileIds: Details:{0}", controllerResponse.ids);
	    }
コード例 #2
0
 public static void getCustomerProfileIdsResponse(getCustomerProfileIdsResponse argument)
 {
     if (null != argument)
     {
     }
 }