public static void WriteHalf_SingleValue_HappyPath(float input, string hexExpectedEncoding)
        {
            byte[] expectedEncoding = hexExpectedEncoding.HexToByteArray();
            var    writer           = new CborWriter();

            writer.WriteHalf((Half)input);
            AssertHelper.HexEqual(expectedEncoding, writer.Encode());
        }
Ejemplo n.º 2
0
        public static void Roundtrip_Half(CborConformanceMode mode, Half input)
        {
            var writer = new CborWriter(mode);

            writer.WriteHalf(input);
            byte[] encoding = writer.Encode();

            var  reader = new CborReader(encoding, mode);
            Half result = reader.ReadHalf();

            Assert.Equal(input, result);
        }