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); }
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); }
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); }