public void MockcreateCustomerShippingAddressTest()
	    {
		    //define all mocked objects as final
            var mockController = GetMockController<createCustomerShippingAddressRequest, createCustomerShippingAddressResponse>();
            var mockRequest = new createCustomerShippingAddressRequest
                {
                    merchantAuthentication = new merchantAuthenticationType {name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey},
                };
            var mockResponse = new createCustomerShippingAddressResponse
                {
                    refId = "1234",
                    sessionToken = "sessiontoken",
                    customerAddressId = "1234",
                };

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

            SetMockControllerExpectations<createCustomerShippingAddressRequest, createCustomerShippingAddressResponse, createCustomerShippingAddressController>(
                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.customerAddressId);
            LogHelper.info(Logger, "createCustomerShippingAddress: Details:{0}", controllerResponse.customerAddressId);
	    }
コード例 #2
0
 public static void createCustomerShippingAddressResponse(createCustomerShippingAddressResponse argument)
 {
     if (null != argument)
     {
     }
 }