コード例 #1
0
        public void IntegerDecode(int i, int prefixLength, byte[] octets)
        {
            var decoder = new IntegerDecoder();
            var result  = decoder.BeginDecode(octets[0], prefixLength);

            if (octets.Length == 1)
            {
                Assert.True(result);
            }
            else
            {
                var j = 1;

                for (; j < octets.Length - 1; j++)
                {
                    Assert.False(decoder.Decode(octets[j]));
                }

                Assert.True(decoder.Decode(octets[j]));
            }

            Assert.Equal(i, decoder.Value);
        }