public void Index([SmartBinder] PaymentFilter filter) { filter.Session = DbSession; var payments = filter.Find(); PropertyBag["filter"] = filter; PropertyBag["payments"] = payments; }
public void Search_by_payer_name() { var payer = DataMother.CreatePayerForBillingDocumentTest(); payer.Name = "Тестовый плательщик " + payer.Id; var payment = new Payment(payer, DateTime.Now, 800); session.Save(payment); var filter = new PaymentFilter(session) { SearchText = "Тестовый плательщик " + payer.Id }; session.Flush(); var payments = filter.Find(); Assert.That(payments.Count, Is.EqualTo(1)); Assert.That(payments[0].Id, Is.EqualTo(payment.Id)); }