예제 #1
0
        public void Config_WithCertificateThumbprint()
        {
            var config = new MBWayConfig
            {
                CertificateThumbprint = ConfigurationManager.AppSettings["CERTIFICATE_THUMBPRINT"],
                MerchantIP            = ConfigurationManager.AppSettings["MERCHANT_IP"],
                MerchantPOSID         = ConfigurationManager.AppSettings["MERCHANT_POSID"],
                AsyncServiceEndpoint  = ConfigurationManager.AppSettings["ASYNC_SERVICE_ENDPOINT"]
            };

            Assert.IsNotNull(config);

            var client = new MBWayClient(config);

            Assert.IsNotNull(client);
        }
예제 #2
0
        public void Config_WithCertificateThumbprintFail()
        {
            var config = new MBWayConfig
            {
                CertificateThumbprint = "123123123123",
                MerchantIP            = ConfigurationManager.AppSettings["MERCHANT_IP"],
                MerchantPOSID         = ConfigurationManager.AppSettings["MERCHANT_POSID"],
                AsyncServiceEndpoint  = ConfigurationManager.AppSettings["ASYNC_SERVICE_ENDPOINT"]
            };

            Assert.IsNotNull(config);

            MBWayClient client = null;

            AssertThrows <ApplicationException>(() =>
            {
                client = new MBWayClient(config);
            });
            Assert.IsNull(client);
        }
예제 #3
0
        public void Config_WithCertificatePathFail()
        {
            var config = new MBWayConfig
            {
                CertificatePass      = @"c:\path\to\nowhere.pfx",
                CertificatePath      = "NotThePassword!",
                MerchantIP           = ConfigurationManager.AppSettings["MERCHANT_IP"],
                MerchantPOSID        = ConfigurationManager.AppSettings["MERCHANT_POSID"],
                AsyncServiceEndpoint = ConfigurationManager.AppSettings["ASYNC_SERVICE_ENDPOINT"]
            };

            Assert.IsNotNull(config);

            MBWayClient client = null;

            AssertThrows <ApplicationException>(() =>
            {
                client = new MBWayClient(config);
            });
            Assert.IsNull(client);
        }