public void GetValue_ForAllFormats_ReturnsBytesPassedIn(byte formatByte) { var info = ValueInfo.ForExtendedType(1, TestBytes.Length, TestExtendedType); var actual = Format.GetValue(formatByte, info, TestBytes); Assert.That(actual, Is.EqualTo(TestBytes)); }
private ValueInfo ReadExtendedType(Stream stream, int contentHeaderSize, int contentSize) { var extendedType = stream.ReadByte(); if (extendedType == -1) { throw Exceptions.UnexpectedEnd(); } return(ValueInfo.ForExtendedType(contentHeaderSize + 1, contentSize, (byte)extendedType)); }