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()); }
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()); }
public static void WriteSimpleValue_InvalidValue_UnsupportedConformance_ShouldThrowArgumentOutOfRangeException(CborConformanceLevel conformanceLevel, CborSimpleValue input) { var writer = new CborWriter(conformanceLevel); Assert.Throws <ArgumentOutOfRangeException>(() => writer.WriteSimpleValue(input)); }