private void AllEncodeOverloadsShouldThrow(CoseMessage msg) { Assert.Throws <CryptographicException>(msg.Encode); byte[] destination = new byte[msg.GetEncodedLength()]; Assert.Throws <CryptographicException>(() => msg.Encode(destination)); Assert.Throws <CryptographicException>(() => msg.TryEncode(destination, out _)); }