예제 #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); });
        }