public void GetEndPoint()
 {
     credential = credentialMngr.GetCredentials(UnitTestConstants.CertificateAPIUserName);
     MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(defaultSoapHandler, credential);
     string endpoint = soapHandler.GetEndPoint();
     Assert.AreEqual(UnitTestConstants.APIEndpointNVP, endpoint);
 }
        public void GetEndpointForDefaultModeWithoutEndpoint()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);

            credential = credentialMngr.GetCredentials(config, UnitTestConstants.CertificateAPIUserName);
            MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            soapHandler.GetEndPoint();
        }
        public void GetEndpointForDefaultModeWithExplicitEndpoint()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
            config.Add(BaseConstants.END_POINT_CONFIG, UnitTestConstants.APIEndpointNVP);

            credential = credentialMngr.GetCredentials(config, UnitTestConstants.CertificateAPIUserName);
            MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            Assert.AreEqual(UnitTestConstants.APIEndpointNVP, soapHandler.GetEndPoint());

            config.Add("PayPalAPI", UnitTestConstants.APIEndpointSOAP);
            credential = credentialMngr.GetCredentials(config, UnitTestConstants.CertificateAPIUserName);
            soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            soapHandler.PortName = "PayPalAPI";
            Assert.AreEqual(UnitTestConstants.APIEndpointSOAP, soapHandler.GetEndPoint());
        }
        public void GetEndpointForLiveMode()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
            config.Add(BaseConstants.APPLICATION_MODE_CONFIG, BaseConstants.SANDBOX_MODE);

            credential = credentialMngr.GetCredentials(config, UnitTestConstants.CertificateAPIUserName);
            MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            Assert.AreEqual(BaseConstants.MERCHANT_CERTIFICATE_SANDBOX_ENDPOINT, soapHandler.GetEndPoint());

            credential = credentialMngr.GetCredentials(config, UnitTestConstants.APIUserName);
            soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            Assert.AreEqual(BaseConstants.MERCHANT_SIGNATURE_SANDBOX_ENDPOINT, soapHandler.GetEndPoint());
        }