public void Creating_WithInvalidVat_ThrowsException(int vat) { var sut = new FinnishVatPercentageBuilder().WithValue(vat); Assert.IsFalse(FinnishVatPercentage.IsValid(vat)); Assert.Throws <ArgumentOutOfRangeException>(() => sut.Build()); }
public SalesInvoiceLine(ProductName name, int amount, ProductUnit unit, decimal unitNetPrice, FinnishVatPercentage vatPercentage) { Name = name; Amount = amount; Unit = unit; UnitNetPrice = unitNetPrice; VatPercentage = vatPercentage; }
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); }