public static void WriteUInt32_SingleValue_HappyPath(uint input, string hexExpectedEncoding) { byte[] expectedEncoding = hexExpectedEncoding.HexToByteArray(); using var writer = new CborWriter(); writer.WriteUInt32(input); AssertHelper.HexEqual(expectedEncoding, writer.GetEncoding()); }
public void WriteSemanticTag(string hexBuffer, ulong semanticTag) { using (ByteBufferWriter buffer = new ByteBufferWriter()) { CborWriter writer = new CborWriter(buffer); if (semanticTag != ulong.MaxValue) { writer.WriteSemanticTag(semanticTag); } writer.WriteUInt32(1563049435); Assert.Equal(hexBuffer, BitConverter.ToString(buffer.WrittenSpan.ToArray()).Replace("-", "")); } }
public override void Write(ref CborWriter writer, uint value) { writer.WriteUInt32(value); }