public void Creating_WithInvalidUnit_ThrowsException(string unit)
        {
            var sut = new ProductUnitBuilder().WithValue(unit);

            Assert.IsFalse(ProductUnit.IsValid(unit));
            Assert.Throws <ArgumentOutOfRangeException>(() => sut.Build());
        }
Exemplo n.º 2
0
        private static bool ContainsUnit(IReadOnlyList <OcrResult.Word> words)
        {
            if (words.Count <= UnitIndex)
            {
                return(false);
            }

            return(ProductUnit.IsValid(words[UnitIndex].Text));
        }