Exemplo n.º 1
0
	    public void MockisAliveTest()
	    {
		    //define all mocked objects as final
            var mockController = GetMockController<ANetApiRequest, isAliveResponse>();
            var mockRequest = new ANetApiRequest
                {
                    merchantAuthentication = new merchantAuthenticationType() { name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey },
                };
            var mockResponse = new isAliveResponse
                {
                    refId = "1234",
                    sessionToken = "sessiontoken",
                };

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

            SetMockControllerExpectations<ANetApiRequest, isAliveResponse, isAliveController>(
                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.Yyyyy);
		    LogHelper.info(Logger, "isAlive: Details:{0}", controllerResponse);
	    }
Exemplo n.º 2
0
        public void MockisAliveTest()
        {
            //define all mocked objects as final
            var mockController = GetMockController <ANetApiRequest, isAliveResponse>();
            var mockRequest    = new ANetApiRequest
            {
                merchantAuthentication = new merchantAuthenticationType()
                {
                    name = "mocktest", Item = "mockKey", ItemElementName = ItemChoiceType.transactionKey
                },
            };
            var mockResponse = new isAliveResponse
            {
                refId        = "1234",
                sessionToken = "sessiontoken",
            };

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

            SetMockControllerExpectations <ANetApiRequest, isAliveResponse, isAliveController>(
                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.Yyyyy);
            LogHelper.info(Logger, "isAlive: Details:{0}", controllerResponse);
        }
 public static void isAliveResponse(isAliveResponse argument)
 {
     if (null != argument)
     {
     }
 }