void GetPayeeStatus() { string cpfCnpj = null; while (String.IsNullOrEmpty(cpfCnpj)) { Console.WriteLine(""); Console.WriteLine("Entre o CPF/CNPJ do favorecido desejado:"); cpfCnpj = Console.ReadLine(); } Payee payee = new Payee(); payee.CpfCnpj = cpfCnpj; try { var response = boletoFacil.GetPayeeStatus(payee); ShowObjectResponseHeader(); Console.WriteLine(response.Data); ShowResponseSerialized(response); } catch (BoletoFacilException e) { HandleException(e); } finally { DoneMessage(); } }
public void GetPayeeStatus() { BoletoFacil boletoFacil = GetBoletoFacil(); Payee payee = Payee; PayeeResponse response = boletoFacil.GetPayeeStatus(payee); Assert.IsNotNull(response); Assert.IsTrue(response.Success); Assert.IsNotNull(response.Data); Assert.IsInstanceOfType(response.Data, typeof(Payee)); Assert.AreEqual("Aprovado", response.Data.Status); }
public void GetPayeeStatusInvalidPayeeException() { BoletoFacil boletoFacil = GetBoletoFacil(); Payee payee = new Payee(); payee.CpfCnpj = "12345678000199"; BoletoFacilRequestException response = AssertException <BoletoFacilRequestException>(() => boletoFacil.GetPayeeStatus(payee)); Assert.IsNotNull(response); Assert.AreEqual(400, response.HTTPStatusCode); Assert.IsFalse(response.Error.Success); Assert.AreEqual("Favorecido com CPF/CNPJ 12345678000199 inválido ou não encontrado", response.Error.ErrorMessage); }