public void Creating_WithInvalidUnit_ThrowsException(string unit) { var sut = new ProductUnitBuilder().WithValue(unit); Assert.IsFalse(ProductUnit.IsValid(unit)); Assert.Throws <ArgumentOutOfRangeException>(() => sut.Build()); }
private static bool ContainsUnit(IReadOnlyList <OcrResult.Word> words) { if (words.Count <= UnitIndex) { return(false); } return(ProductUnit.IsValid(words[UnitIndex].Text)); }