public void GenerateHeaderStrategyWithToken()
        {
            signHttpHeaderAuthStrategy = new SignatureHttpHeaderAuthStrategy(Constants.APIEndpointSOAP);
            TokenAuthorization toknAuthorization = new TokenAuthorization(Constants.AccessToken, Constants.TokenSecret);

            signCredential = new SignatureCredential("testusername", "testpassword", "testsignature", toknAuthorization);
            Dictionary <string, string> header = signHttpHeaderAuthStrategy.GenerateHeaderStrategy(signCredential);
            string authHeader = header[BaseConstants.PayPalAuthorizationMerchantHeader];

            string[] headers = authHeader.Split(',');
            Assert.AreEqual("token=" + Constants.AccessToken, headers[0]);
        }
 public void GenerateHeaderStrategyWithoutToken()
 {
     SignatureHttpHeaderAuthStrategy signatureHttpHeaderAuthStrategy = new SignatureHttpHeaderAuthStrategy(Constants.APIEndpointNVP);
     signCredential = new SignatureCredential("testusername", "testpassword", "testsignature");
     Dictionary<string, string> header = signatureHttpHeaderAuthStrategy.GenerateHeaderStrategy(signCredential);
     string username = header[BaseConstants.PayPalSecurityUserIdHeader];
     string password = header[BaseConstants.PayPalSecurityPasswordHeader];
     string sign = header[BaseConstants.PayPalSecuritySignatureHeader];
     Assert.AreEqual("testusername", username);
     Assert.AreEqual("testpassword", password);
     Assert.AreEqual("testsignature", sign);
 }
        public void GenerateHeaderStrategyWithToken()
        {
            signHttpHeaderAuthStrategy = new SignatureHttpHeaderAuthStrategy(UnitTestConstants.APIEndpointSOAP);
            TokenAuthorization toknAuthorization = new TokenAuthorization(UnitTestConstants.AccessToken, UnitTestConstants.TokenSecret);

            signCredential = new SignatureCredential("testusername", "testpassword", "testsignature", toknAuthorization);
            Dictionary <string, string> header = signHttpHeaderAuthStrategy.GenerateHeaderStrategy(signCredential);
            string authHeader = header[BaseConstants.PAYPAL_AUTHORIZATION_MERCHANT_HEADER];

            string[] headers = authHeader.Split(',');
            Assert.AreEqual("token=" + UnitTestConstants.AccessToken, headers[0]);
        }
        public void GenerateHeaderStrategyWithoutToken()
        {
            signHttpHeaderAuthStrategy = new SignatureHttpHeaderAuthStrategy(Constants.APIEndpointSOAP);
            signCredential             = new SignatureCredential("testusername", "testpassword", "testsignature");
            Dictionary <string, string> header = signHttpHeaderAuthStrategy.GenerateHeaderStrategy(signCredential);
            string username = header[BaseConstants.PayPalSecurityUserIdHeader];
            string password = header[BaseConstants.PayPalSecurityPasswordHeader];
            string sign     = header[BaseConstants.PayPalSecuritySignatureHeader];

            Assert.AreEqual("testusername", username);
            Assert.AreEqual("testpassword", password);
            Assert.AreEqual("testsignature", sign);
        }
        public void GenerateHeaderStrategyWithoutToken()
        {
            signHttpHeaderAuthStrategy = new SignatureHttpHeaderAuthStrategy(UnitTestConstants.APIEndpointSOAP);
            signCredential             = new SignatureCredential("testusername", "testpassword", "testsignature");
            Dictionary <string, string> header = signHttpHeaderAuthStrategy.GenerateHeaderStrategy(signCredential);
            string username = header[BaseConstants.PAYPAL_SECURITY_USERID_HEADER];
            string password = header[BaseConstants.PAYPAL_SECURITY_PASSWORD_HEADER];
            string sign     = header[BaseConstants.PAYPAL_SECURITY_SIGNATURE_HEADER];

            Assert.AreEqual("testusername", username);
            Assert.AreEqual("testpassword", password);
            Assert.AreEqual("testsignature", sign);
        }
 public void GenerateHeaderStrategyWithToken()
 {
     signHttpHeaderAuthStrategy = new SignatureHttpHeaderAuthStrategy(Constants.APIEndpointNVP);
     TokenAuthorization toknAuthorization = new TokenAuthorization(Constants.AccessToken, Constants.TokenSecret);
     signCredential = new SignatureCredential("testusername", "testpassword", "testsignature", toknAuthorization);
     Dictionary<string, string> header = signHttpHeaderAuthStrategy.GenerateHeaderStrategy(signCredential);
     string authHeader = header[BaseConstants.PayPalAuthorizationPlatformHeader];
     string[] headers = authHeader.Split(',');
     Assert.AreEqual("token=" + Constants.AccessToken, headers[0]);
 }