Beispiel #1
0
        public static IEnumerable <FiscalReceiptTotal> InvalidTotals()
        {
            yield return(default(FiscalReceiptTotal));

            var validTotal = new Modify <FiscalReceiptTotal>(ValidTotal);

            yield return(validTotal.Modified(t => { t.VatRateLetter = null; }));

            yield return(validTotal.Modified(t => { t.VatRateLetter = ""; }));

            yield return(validTotal.Modified(t => { t.VatRateLetter = " "; }));

            yield return(validTotal.Modified(t => { t.VatRatePercentValue = -4m; }));
        }
Beispiel #2
0
        public static IEnumerable <FiscalReceiptDiscountOrMarkup> InvalidDiscountOrMarkups()
        {
            yield return(default(FiscalReceiptDiscountOrMarkup));

            var validDiscountOrMarkup = new Modify <FiscalReceiptDiscountOrMarkup>(ValidDiscountOrMarkup);

            yield return(validDiscountOrMarkup.Modified(dm => { dm.Name = null; }));

            yield return(validDiscountOrMarkup.Modified(dm => { dm.Name = ""; }));

            yield return(validDiscountOrMarkup.Modified(dm => { dm.Name = " "; }));

            yield return(validDiscountOrMarkup.Modified(dm => { dm.VatRateLetter = null; }));

            yield return(validDiscountOrMarkup.Modified(dm => { dm.VatRateLetter = ""; }));

            yield return(validDiscountOrMarkup.Modified(dm => { dm.VatRateLetter = " "; }));
        }
Beispiel #3
0
        public static IEnumerable <FiscalReceiptItem> InvalidReceiptItems()
        {
            yield return(default(FiscalReceiptItem));

            var validItem = new Modify <FiscalReceiptItem>(ValidReceiptItem);

            yield return(validItem.Modified(ri => { ri.Name = null; }));

            yield return(validItem.Modified(ri => { ri.Name = ""; }));

            yield return(validItem.Modified(ri => { ri.Name = " "; }));

            yield return(validItem.Modified(ri => { ri.VatRateLetter = null; }));

            yield return(validItem.Modified(ri => { ri.VatRateLetter = ""; }));

            yield return(validItem.Modified(ri => { ri.VatRateLetter = " "; }));
        }
Beispiel #4
0
        public static IEnumerable <FiscalReceipt> InvalidReceipts()
        {
            yield return(default(FiscalReceipt));

            var validReceipt = new Modify <FiscalReceipt>(ValidReceipt);

            yield return(default(FiscalReceipt));

            yield return(validReceipt.Modified(r => { r.Number = null; }));

            yield return(validReceipt.Modified(r => { r.Number = string.Empty; }));

            yield return(validReceipt.Modified(r => { r.Number = " "; }));

            yield return(validReceipt.Modified(r => { r.TaxPayerName = null; }));

            yield return(validReceipt.Modified(r => { r.TaxPayerName = string.Empty; }));

            yield return(validReceipt.Modified(r => { r.TaxPayerName = " "; }));

            yield return(validReceipt.Modified(r => { r.TaxPayerAddress = null; }));

            yield return(validReceipt.Modified(r => { r.TaxPayerAddress = string.Empty; }));

            yield return(validReceipt.Modified(r => { r.TaxPayerAddress = " "; }));

            yield return(validReceipt.Modified(r => { r.TaxPayerNip = null; }));

            yield return(validReceipt.Modified(r => { r.TaxPayerNip = string.Empty; }));

            yield return(validReceipt.Modified(r => { r.TaxPayerNip = " "; }));

            yield return(validReceipt.Modified(r => { r.AddressOfSalePlace = null; }));

            yield return(validReceipt.Modified(r => { r.AddressOfSalePlace = string.Empty; }));

            yield return(validReceipt.Modified(r => { r.AddressOfSalePlace = " "; }));

            yield return(validReceipt.Modified(r => { r.NameOfSalePlace = null; }));

            yield return(validReceipt.Modified(r => { r.NameOfSalePlace = string.Empty; }));

            yield return(validReceipt.Modified(r => { r.NameOfSalePlace = " "; }));

            yield return(validReceipt.Modified(r => { r.CurrencyCode = null; }));

            yield return(validReceipt.Modified(r => { r.CurrencyCode = string.Empty; }));

            yield return(validReceipt.Modified(r => { r.CurrencyCode = " "; }));

            yield return(validReceipt.Modified(r => { r.PaymentForm = null; }));

            yield return(validReceipt.Modified(r => { r.PaymentForm = string.Empty; }));

            yield return(validReceipt.Modified(r => { r.PaymentForm = " "; }));

            yield return(validReceipt.Modified(r => { r.TimeAndDateOfSale = new DateTime(2004, 12, 31, 23, 59, 59); }));

            yield return(validReceipt.Modified(r => { r.TaxPayerNip = "0000000000"; }));

            yield return(validReceipt.Modified(r => { r.Items = null; }));

            yield return(validReceipt.Modified(r => { r.Items = new FiscalReceiptItem[0]; }));

            yield return(validReceipt.Modified(r => { r.Items = new FiscalReceiptItem[] { null }; }));

            yield return(validReceipt.Modified(r => { r.DiscountsAndMarkups = new FiscalReceiptDiscountOrMarkup[] { null }; }));

            yield return(validReceipt.Modified(r => { r.TotalsPerVatRate = null; }));

            yield return(validReceipt.Modified(r => { r.TotalsPerVatRate = new FiscalReceiptTotal[0]; }));

            yield return(validReceipt.Modified(r => { r.TotalsPerVatRate = new FiscalReceiptTotal[] { null }; }));

            yield return(validReceipt.Modified(r => { r.Items = new[] { new FiscalReceiptItem {
                                                                            Name = "1", VatRateLetter = "A"
                                                                        },
                                                                        new FiscalReceiptItem {
                                                                            Name = "2", VatRateLetter = "B"
                                                                        } };
                                                      r.TotalsPerVatRate = new[] { new FiscalReceiptTotal {
                                                                                       VatRateLetter = "A"
                                                                                   } }; }));

            yield return(validReceipt.Modified(r => { r.Items = new[] { new FiscalReceiptItem {
                                                                            Name = "1", VatRateLetter = "A"
                                                                        } };
                                                      r.TotalsPerVatRate = new[] { new FiscalReceiptTotal {
                                                                                       VatRateLetter = "A"
                                                                                   },
                                                                                   new FiscalReceiptTotal {
                                                                                       VatRateLetter = "B"
                                                                                   } }; }));

            yield return(validReceipt.Modified(r => { r.DiscountsAndMarkups = new[] { new FiscalReceiptDiscountOrMarkup {
                                                                                          Name = "1", VatRateLetter = "B"
                                                                                      } };
                                                      r.Items = new[] { new FiscalReceiptItem {
                                                                            Name = "1", VatRateLetter = "A"
                                                                        } };
                                                      r.TotalsPerVatRate = new[] { new FiscalReceiptTotal {
                                                                                       VatRateLetter = "A"
                                                                                   } }; }));

            yield return(validReceipt.Modified(r => { r.Items = new[] { new FiscalReceiptItem {
                                                                            Name = "1", VatRateLetter = "A"
                                                                        } };
                                                      r.TotalsPerVatRate = new[] { new FiscalReceiptTotal {
                                                                                       VatRateLetter = "A"
                                                                                   },
                                                                                   new FiscalReceiptTotal {
                                                                                       VatRateLetter = "A"
                                                                                   } }; }));

            foreach (var invalidTotal in InvalidTotals())
            {
                yield return(validReceipt.Modified(r => { r.TotalsPerVatRate = r.TotalsPerVatRate.Concat(new[] { invalidTotal }).ToList(); }));
            }
            foreach (var invalidItem in InvalidReceiptItems())
            {
                yield return(validReceipt.Modified(r => { r.Items = r.Items.Concat(new[] { invalidItem }).ToList(); }));
            }
            foreach (var invalidDiscountOrMarkup in InvalidDiscountOrMarkups())
            {
                yield return(validReceipt.Modified(r => { r.DiscountsAndMarkups = r.DiscountsAndMarkups.Concat(new[] { invalidDiscountOrMarkup }).ToList(); }));
            }
        }