Example #1
0
 public void PaymentThrowOnNullArgs()
 {
     Assert.Throws <ArgumentNullException>(delegate { Payment.Create(null); });
     Assert.Throws <ArgumentNullException>(delegate { Payment.CreateRaw(null); });
     Assert.Throws <ArgumentNullException>(delegate { Payment.Retrieve(null); });
     Assert.Throws <ArgumentNullException>(delegate { Payment.RetrieveRaw(null); });
     Assert.Throws <ArgumentNullException>(delegate { Payment.Abort(null); });
 }
Example #2
0
        public void PaymentThrowOnEmptySecretKey()
        {
            Configuration.SecretKey = string.Empty;

            Assert.Throws <ConfigurationException>(delegate { Payment.Create(this.paymentData); });
            Assert.Throws <ConfigurationException>(delegate { Payment.CreateRaw(PaymentRaw); });
            Assert.Throws <ConfigurationException>(delegate { Payment.List(); });
            Assert.Throws <ConfigurationException>(delegate { Payment.ListRaw(); });
            Assert.Throws <ConfigurationException>(delegate { Payment.Retrieve(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Payment.RetrieveRaw(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Payment.Abort(PaymentID); });
        }
Example #3
0
        public void PaymentThrowOnMissingSecurityProtocol()
        {
            Configuration.SecretKey = "mysecretkey";
            System.Net.ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Tls;
#if !__MonoCS__
            System.Net.ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Tls11;
            System.Net.ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Tls12;
#endif
            Assert.Throws <ConfigurationException>(delegate { Payment.Create(this.paymentData); });
            Assert.Throws <ConfigurationException>(delegate { Payment.CreateRaw(PaymentRaw); });
            Assert.Throws <ConfigurationException>(delegate { Payment.List(); });
            Assert.Throws <ConfigurationException>(delegate { Payment.ListRaw(); });
            Assert.Throws <ConfigurationException>(delegate { Payment.Retrieve(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Payment.RetrieveRaw(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Payment.Abort(PaymentID); });
        }