public void NormalDonation()
 {
     var reader = new FakeScanner(@"
     16805	01.06.2010	80,00	H	KD	Mustermann, Markus");
     var donation = new ProcessingDonations(reader).NextDonation;
     AssertEx.DonationEqual(new Donation(80, new DateTime(2010, 06, 01), "Mustermann, Markus", 16805),
         donation);
 }
 public void MultiLine()
 {
     var reader = new FakeScanner(@"
     01.06.2010	80,00	H	KD	Mustermann, Markus
             Continued");
     var donation = new ProcessingOtherProceeds(reader).NextDonation;
     AssertEx.DonationEqual(new Donation(80, new DateTime(2010, 06, 01),
         "Mustermann, Markus Continued", 998), donation);
 }
        public void DonorMultilineOrganization()
        {
            var reader = new FakeScanner(@"	16805	Organization	Schlossallee 14	1	100,00	51,28
            Irgendwo
            77123 Irgendwo");

            var donorProcessor = new ProcessDonors(reader);
            AssertDonorEqual(new Donor(16805, "Organization", "Irgendwo", "Schlossallee 14", "77123", "Irgendwo",
                new string[] {  }, "", 1, 100.00m), donorProcessor.NextDonor);
        }
        public void DonorLargeAmount()
        {
            var reader = new FakeScanner(@"	16805	Mustermann, Markus	Schlossallee 14	1	2.100,00	1.051,28
            77123 Irgendwo");

            var donorProcessor = new ProcessDonors(reader);
            AssertDonorEqual(new Donor(16805, "Mustermann, Markus", "", "Schlossallee 14", "77123", "Irgendwo",
                    new string[] { }, string.Empty, 1, 2100.00m),
                donorProcessor.NextDonor);
        }
        public void DonorEmail()
        {
            var reader = new FakeScanner(@"	16805	Mustermann, Markus	Schlossallee 14	1	100,00	51,28
            77123 Irgendwo
                [email protected]");

            var donorProcessor = new ProcessDonors(reader);
            AssertDonorEqual(new Donor(16805, "Mustermann, Markus", "", "Schlossallee 14", "77123", "Irgendwo",
                    new string[] {  }, "*****@*****.**", 1, 100.00m), donorProcessor.NextDonor);
        }
 public void Excluded()
 {
     MyReplacementManager.CreateReplacementFile(@"
     [K3224]
     Exclude=^.+$");
     var reader = new FakeScanner(@"
     23.11.2012	US$	209,64	162,20	H	8021	SWZ Member gift");
     var processingDonations = new ProcessingOtherTransfers(3224, reader);
     Assert.That(processingDonations.NextDonation, Is.Null);
 }
        public void DonorLongPhoneAndEmail()
        {
            var reader = new FakeScanner(@"	16805	Mustermann, Markus	Schlossallee 14	p: 02736/1234561, d: 012	1	100,00	51,28
                34/5678
            77123 Irgendwo
                [email protected]");

            var donorProcessor = new ProcessDonors(reader);
            AssertDonorEqual(new Donor(16805, "Mustermann, Markus", "", "Schlossallee 14", "77123", "Irgendwo",
                    new[] { "p: 02736/1234561, d: 01234/5678" }, "*****@*****.**", 1, 100.00m), donorProcessor.NextDonor);
        }
 public void MultiLineTransfer()
 {
     MyReplacementManager.CreateReplacementFile(string.Empty);
     var reader = new FakeScanner(@"
     23.11.2012	US$	209,64	162,20	H	8021	437921 BT-BANK TRANSFER
                     OPP_TransAmount=-209,64");
     var processingDonations = new ProcessingOtherTransfers(3224, reader);
     AssertEx.DonationEqual(new Donation(162.20m, new DateTime(2012, 11, 23),
         "437921 BT-BANK TRANSFER", UInt32.MaxValue, "Netto; US$ 209,64", 209.64m, "USD"),
         processingDonations.NextDonation);
 }
 public void Replacement()
 {
     MyReplacementManager.CreateReplacementFile(@"
     [Replacements]
     579941 OPP_TransAmount=Mustermann, Markus
     ");
     var reader = new FakeScanner(@"
     23.10.2013	US$	90,00	65,21	H	1310	579941 OPP_TransAmount=-90,00");
     var processingDonations = new ProcessingOtherTransfers(3224, reader);
     var donation = processingDonations.NextDonation;
     Assert.That(donation.Donor, Is.EqualTo("Mustermann, Markus"));
 }
        public void MultipleMonthsGiveSameDonorNo()
        {
            MyReplacementManager.CreateReplacementFile(string.Empty);
            var reader = new FakeScanner(@"
            23.11.2012	US$	209,64	162,20	H	8021	SWZ Member gift");
            var processingDonations = new ProcessingOtherTransfers(3224, reader);
            var donation = processingDonations.NextDonation;
            var firstDonorNo = donation.DonorNo;

            reader = new FakeScanner(@"
            21.12.2012	US$	450,00	423,18	H	8022	SWZ Member gift");
            processingDonations = new ProcessingOtherTransfers(3224, reader);
            donation = processingDonations.NextDonation;
            Assert.AreEqual(firstDonorNo, donation.DonorNo);
        }
        public void SkipPageBreak()
        {
            var reader = new FakeScanner(@"
            16448	22.06.2010	51,13	H	KD 	Mustermann, Markus
            21860	25.06.2010	80,00	H	KD 	Mueller, Frieda

            Projekt	12345  Missionar, Fritz	Soll €	Haben €
            16800	28.06.2010	26,00	H	KD 	doppelt
            11706	30.06.2010	16,00	H	KD 	Musterfrau, Elfriede");
            var processingDonations = new ProcessingDonations(reader);
            AssertEx.DonationEqual(new Donation(51.13m, new DateTime(2010, 06, 22), "Mustermann, Markus", 16448),
                processingDonations.NextDonation);
            AssertEx.DonationEqual(new Donation(80.00m, new DateTime(2010, 06, 25), "Mueller, Frieda", 21860),
                processingDonations.NextDonation);
            AssertEx.DonationEqual(new Donation(26.00m, new DateTime(2010, 06, 28), "doppelt", 16800),
                processingDonations.NextDonation);
            AssertEx.DonationEqual(new Donation(16.00m, new DateTime(2010, 06, 30), "Musterfrau, Elfriede", 11706),
                processingDonations.NextDonation);
        }
        public void SkipToDonor()
        {
            var reader = new FakeScanner(@"Spenderübersicht
            Spender-	Telefon (privat, dienstl.)	Spenden
            Nr.	Name	Adresse	Fax, E-Mail	Anz.	€	€*
            16805	Mustermann, Markus	Schlossallee 14	1	100,00	51,28
            77123 Irgendwo");

            var donorProcessor = new ProcessDonors(reader);
            AssertDonorEqual(new Donor(16805, "Mustermann, Markus", "", "Schlossallee 14",
                    "77123", "Irgendwo", new string[] {  }, string.Empty, 1, 100.00m),
                donorProcessor.NextDonor);
        }
        public void SkipPageBreak()
        {
            var reader = new FakeScanner(@"	16805	Mustermann, Markus	Schlossallee 14	1	100,00	51,28

            Projekt:	12345	Markus Missionar	Soll €	Haben €
            77123 Irgendwo");

            var donorProcessor = new ProcessDonors(reader);
            AssertDonorEqual(new Donor(16805, "Mustermann, Markus", "", "Schlossallee 14",
                    "77123", "Irgendwo", new string[] {  }, string.Empty, 1, 100.00m),
                donorProcessor.NextDonor);
        }
        public void DonorWithPhoneEurOnly()
        {
            var reader = new FakeScanner(@"	16805	Mustermann, Markus	Schlossallee 14	p: 02736/1234561	1	100,00
            77123 Irgendwo");

            var donorProcessor = new ProcessDonors(reader);
            AssertDonorEqual(new Donor(16805, "Mustermann, Markus", "", "Schlossallee 14", "77123", "Irgendwo",
                    new[] {"p: 02736/1234561"}, string.Empty, 1, 100.00m), donorProcessor.NextDonor);
        }
 public void AccountNumber_5parts()
 {
     var reader = new FakeScanner(@"	3215	Sonstige Einnahmen (steuerneutral)	0,00	50,00");
     var account = new DummyAccount(reader);
     Assert.That(account.Account, Is.EqualTo(3215));
 }
 public void Transfer()
 {
     MyReplacementManager.CreateReplacementFile(string.Empty);
     var reader = new FakeScanner(@"
     23.11.2012	US$	209,64	162,20	H	8021	SWZ Member gift");
     var processingDonations = new ProcessingOtherTransfers(3224, reader);
     AssertEx.DonationEqual(new Donation(162.20m, new DateTime(2012, 11, 23),
         "SWZ Member gift", UInt32.MaxValue, "Netto; US$ 209,64", 209.64m, "USD"), processingDonations.NextDonation);
 }