Exemplo n.º 1
0
        public void Encode_ShouldUseCTable()
        {
            bool result;

            bool T(byte currentEncoding, params char[] nextChars)
            => Code128.ShouldUseCTable(nextChars, currentEncoding);

            result = T(Code128Constants.StartCSymbol, Code128Constants.FNC1, '1', '2');
            result.Should().BeTrue();

            result = T(Code128Constants.StartCSymbol, Code128Constants.FNC1, '1');
            result.Should().BeFalse();

            result = T(Code128Constants.StartCSymbol, '0', Code128Constants.FNC1, '1');
            result.Should().BeFalse();

            result = T(Code128Constants.StartBSymbol, '0', '1', Code128Constants.FNC1, '2', '3');
            result.Should().BeTrue();

            result = T(Code128Constants.StartBSymbol, '0', '1', Code128Constants.FNC1);
            result.Should().BeFalse();
        }