public void Search_by_inn() { var client = DataMother.CreateTestClientWithUser(); var payer = client.Payers.First(); payer.INN = DataMother.RandomInn(); session.Save(payer); session.Flush(); var items = new PayerFilter(session) { SearchText = payer.INN, SearchBy = SearchBy.Inn, ClientStatus = SearchClientStatus.All }.Find(); Assert.That(items.Count, Is.EqualTo(1)); Assert.That(items[0].PayerId, Is.EqualTo(payer.Id)); }
public void Ignore_inn_from_black_list() { var payer = DataMother.CreatePayerForBillingDocumentTest(); var recipient = session.Query <Recipient>().First(); payer.INN = DataMother.RandomInn(); new IgnoredInn(payer.INN).Save(); session.Save(payer); var payments = new List <Payment> { new Payment { Sum = 800, RecipientClient = new Payment.BankClient(recipient.Name, recipient.INN, recipient.BankAccountNumber), PayerClient = new Payment.BankClient(payer.Name, payer.INN, "") } }; var identifyPayments = Payment.Identify(payments); Assert.That(identifyPayments.First().Payer, Is.Null); }
public void Identify_payment() { var payer = DataMother.CreatePayerForBillingDocumentTest(); var recipient = session.Query <Recipient>().First(); payer.INN = DataMother.RandomInn(); session.Save(payer); var payments = new List <Payment> { new Payment { Sum = 800, RecipientClient = new Payment.BankClient(recipient.Name, recipient.INN, recipient.BankAccountNumber), PayerClient = new Payment.BankClient(payer.Name, payer.INN, "") } }; session.Flush(); var identifyPayments = Payment.Identify(payments); Assert.That(identifyPayments.First().Payer, Is.EqualTo(payer)); }