示例#1
0
#pragma warning restore CS0618

        public static byte[] CheckEncodeToBytes(CBORObject o)
        {
            byte[] bytes = o.EncodeToBytes();
            if (bytes.Length != o.CalcEncodedSize())
            {
                string msg = "encoded size doesn't match:\no = " +
                             TestCommon.ToByteArrayString(bytes) + "\nostring = " + o.ToString();
                Assert.AreEqual(bytes.Length, o.CalcEncodedSize(), msg);
            }
            return(bytes);
        }