Beispiel #1
0
 public static void WriteSimpleValue_SingleValue_HappyPath(CborSimpleValue input, string hexExpectedEncoding)
 {
     byte[] expectedEncoding = hexExpectedEncoding.HexToByteArray();
     using var writer = new CborWriter();
     writer.WriteSimpleValue(input);
     AssertHelper.HexEqual(expectedEncoding, writer.GetEncoding());
 }
Beispiel #2
0
        public static void WriteSimpleValue_InvalidValue_LaxConformance_ShouldSucceed(CborSimpleValue input, string hexExpectedEncoding)
        {
            byte[] expectedEncoding = hexExpectedEncoding.HexToByteArray();
            var    writer           = new CborWriter(CborConformanceLevel.Lax);

            writer.WriteSimpleValue(input);
            AssertHelper.HexEqual(expectedEncoding, writer.Encode());
        }
Beispiel #3
0
        public static void WriteSimpleValue_InvalidValue_UnsupportedConformance_ShouldThrowArgumentOutOfRangeException(CborConformanceLevel conformanceLevel, CborSimpleValue input)
        {
            var writer = new CborWriter(conformanceLevel);

            Assert.Throws <ArgumentOutOfRangeException>(() => writer.WriteSimpleValue(input));
        }