Пример #1
0
        public void ShouldThrowExceptionIfDataIndexIsOutOfRange()
        {
            var converter = new Int32Converter();

            var action = new Action(() => converter.ConvertBack(new byte[] { 0x01, 0x02, 0x03 }, 1));

            action.Should().Throw <ArgumentException>();
        }
Пример #2
0
        public void ShouldReturnDataValueAndNextDataIndex()
        {
            var converter = new Int32Converter();

            var(dataValue, nextDataIndex) = converter.ConvertBack(new byte[] { 0xDD, 0x2A, 0x00, 0x00, 0x00 }, 1);

            dataValue.Should().Be(0x2A);
            nextDataIndex.Should().Be(0x05);
        }