public void Setup()
        {
            payer   = DataMother.CreatePayer();
            account = DataMother.Report(payer);
            report  = account.Report;
            session.Save(payer);
            session.Save(account);

            payer.Reports.Add(report);
            account.Payment = 5000;
            session.Save(payer);
        }
Example #2
0
        public void Include_report_into_balance_calculation()
        {
            var client = DataMother.TestClient();
            var payer  = client.Payers.First();
            var report = DataMother.Report(payer);

            report.Payment = 1500;

            session.Save(client);
            session.Save(payer);
            session.Save(report);

            session.Refresh(payer);
            Assert.That(payer.TotalSum, Is.EqualTo(1500));
        }
        public void SetUp()
        {
            client = DataMother.CreateTestClientWithAddressAndUser();
            payer  = client.Payers.First();

            account = DataMother.Report(payer);
            report  = account.Report;
            session.Save(account);

            payer.Recipient = session.Query <Recipient>().First();
            payer.Reports.Add(report);

            Open(payer);
            AssertText("Плательщик");
        }
Example #4
0
        public void Delete_account_after_delete_report()
        {
            var account = DataMother.Report(payer);

            Save(account);
            Assert.That(account.Id, Is.Not.EqualTo(0u));
            Assert.That(account.Report.Id, Is.Not.EqualTo(0u));
            session.Clear();
            session.Delete(account.Report);
            FlushAndCommit();

            processor.Execute();

            session.Clear();
            account = session.Get <ReportAccount>(account.Id);
            Assert.That(account, Is.Null);
        }
        public void Include_report_into_invoice_with_custom_message()
        {
            var report = DataMother.Report(payer);

            report.Payment     = 5000;
            report.Description = "Стат. отчет за {0}";
            session.Save(report);
            session.Refresh(payer);

            var invoiceDate = new DateTime(2011, 09, 11);
            var invoice     = new Invoice(payer, invoiceDate.ToPeriod(), invoiceDate);

            Assert.That(invoice.Parts.Count, Is.EqualTo(2), invoice.Parts.Implode());
            var part = invoice.Parts[1];

            Assert.That(part.Sum, Is.EqualTo(5000));
            Assert.That(part.Name, Is.EqualTo("Стат. отчет за сентябрь"));
        }
        public void If_payer_have_report_it_not_disabled()
        {
            var payer  = DataMother.CreatePayer();
            var report = DataMother.Report(payer);

            Save(payer);
            Save(report);

            Flush();

            var filter = new PayerFilter(session);
            var items  = filter.Find();

            var item = items.FirstOrDefault(i => payer.Id == i.PayerId);

            Assert.That(item, Is.Not.Null, "не удалось найти плателщика {0} нашли {1}", payer.Id, items.Implode());
            Assert.That(item.IsDisabled, Is.False);
        }