public void ShouldEndAfterRepeat() { var ra = new RandomAccess(new byte[] { 0x01, 0x31, 0x07 }).UnpackRunLengthEncoding(); Assert.AreEqual(8, ra.Length); Assert.AreEqual("11111111", ra.ToAscii()); }
public void ShouldUnpackRleSimpleBlock() { // Skip one '1', repeat 7 '1'. var ra = new RandomAccess(new byte[] { 0x01, 0x31, 0x07 }).UnpackRunLengthEncoding(); Assert.AreEqual(8, ra.Length); Assert.AreEqual("11111111", ra.ToAscii()); }
public void ShouldUnpackRleDoubleBlock() { // Skip one '1', repeat 7 '1', skip '2', '3', repeat '3' 3 times var ra = new RandomAccess(new byte[] { 0x01, 0x31, 0x07, 0x02, 0x32, 0x33, 0x03 }).UnpackRunLengthEncoding(); Assert.AreEqual(13, ra.Length); Assert.AreEqual("1111111123333", ra.ToAscii()); }