public void SetProxy() { BoletoFacil boletoFacil = new BoletoFacil(BoletoFacilEnvironment.Sandbox, "ABC"); Assert.IsNotNull(boletoFacil); Assert.IsFalse(boletoFacil.UseProxy); Assert.IsNull(boletoFacil.ProxyAddress); Assert.IsNull(boletoFacil.ProxyUsername); Assert.IsNull(boletoFacil.ProxyPassword); boletoFacil.SetProxy("http://localhost", "username", "password"); Assert.IsTrue(boletoFacil.UseProxy); Assert.AreEqual("http://localhost", boletoFacil.ProxyAddress); Assert.AreEqual("username", boletoFacil.ProxyUsername); Assert.AreEqual("password", boletoFacil.ProxyPassword); }
public void IssueChargeWithProxy() { BoletoFacil boletoFacil = GetBoletoFacil(); boletoFacil.SetProxy("http://localhost", "username", "password"); Assert.IsTrue(boletoFacil.UseProxy); Charge charge = Charge; ChargeResponse response = boletoFacil.IssueCharge(charge); Assert.IsNotNull(response); Assert.IsTrue(response.Success); Assert.AreEqual(1, response.Data.Charges.Length); Assert.IsInstanceOfType(response.Data.Charges[0], typeof(Charge)); Assert.AreEqual("101", response.Data.Charges[0].Code); Assert.AreEqual(StartDate.Date, response.Data.Charges[0].DueDate.Date); Assert.AreEqual(BaseUrl, response.Data.Charges[0].Link.Substring(0, BaseUrl.Length)); Assert.AreEqual("03399.63290 64000.001014 00236.601027 8 67150000025000", response.Data.Charges[0].PayNumber); }