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());
 }
Beispiel #2
0
        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("-", ""));
            }
        }
Beispiel #3
0
 public override void Write(ref CborWriter writer, uint value)
 {
     writer.WriteUInt32(value);
 }