Esempio n. 1
0
        public void Creating_WithInvalidVat_ThrowsException(int vat)
        {
            var sut = new FinnishVatPercentageBuilder().WithValue(vat);

            Assert.IsFalse(FinnishVatPercentage.IsValid(vat));
            Assert.Throws <ArgumentOutOfRangeException>(() => sut.Build());
        }
Esempio n. 2
0
 public SalesInvoiceLine(ProductName name, int amount, ProductUnit unit, decimal unitNetPrice, FinnishVatPercentage vatPercentage)
 {
     Name          = name;
     Amount        = amount;
     Unit          = unit;
     UnitNetPrice  = unitNetPrice;
     VatPercentage = vatPercentage;
 }
Esempio n. 3
0
        private static bool ContainsFinnishVatPercentage(IReadOnlyList <OcrResult.Word> words)
        {
            if (!words.Any())
            {
                return(false);
            }


            if (int.TryParse(words[VatIndex].Text, out var integerValue))
            {
                return(FinnishVatPercentage.IsValid(integerValue));
            }

            return(false);
        }