public static void ReadByteString_SingleValue_HappyPath(string hexExpectedValue, string hexEncoding) { byte[] encoding = hexEncoding.HexToByteArray(); byte[] expectedValue = hexExpectedValue.HexToByteArray(); var reader = new CborValueReader(encoding); byte[] output = reader.ReadByteString(); Assert.Equal(expectedValue, output); }
public static void Roundtrip_ByteString(string?hexInput) { byte[]? input = hexInput?.HexToByteArray(); #endif using var writer = new CborWriter(); writer.WriteByteString(input); byte[] encoding = writer.ToArray(); var reader = new CborValueReader(encoding); byte[] result = reader.ReadByteString(); AssertHelper.HexEqual(input ?? Array.Empty <byte>(), result); }