Пример #1
0
 public void RefundThrowOnNullArgs()
 {
     Assert.Throws <ArgumentNullException>(delegate { Refund.Create(null); });
     Assert.Throws <ArgumentNullException>(delegate { Refund.CreateRaw(null); });
     Assert.Throws <ArgumentNullException>(delegate { Refund.List(null); });
     Assert.Throws <ArgumentNullException>(delegate { Refund.ListRaw(null); });
     Assert.Throws <ArgumentNullException>(delegate { Refund.Retrieve(null, null); });
     Assert.Throws <ArgumentNullException>(delegate { Refund.RetrieveRaw(null, null); });
 }
Пример #2
0
        public void RefundThrowOnEmptySecretKey()
        {
            Configuration.SecretKey = string.Empty;

            Assert.Throws <ConfigurationException>(delegate { Refund.Create(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Refund.CreateRaw(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Refund.List(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Refund.ListRaw(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Refund.Retrieve(PaymentID, RefundID); });
            Assert.Throws <ConfigurationException>(delegate { Refund.RetrieveRaw(PaymentID, RefundID); });
        }
Пример #3
0
        public void RefundThrowOnMissingSecurityProtocol()
        {
            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 { Refund.Create(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Refund.CreateRaw(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Refund.List(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Refund.ListRaw(PaymentID); });
            Assert.Throws <ConfigurationException>(delegate { Refund.Retrieve(PaymentID, RefundID); });
            Assert.Throws <ConfigurationException>(delegate { Refund.RetrieveRaw(PaymentID, RefundID); });
        }