Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the least requirements to have, to say a custom exception is serializable?

I have bunch of custom exceptions in my solution's legacy code. And I want to test all

the custom exceptions introduced in my projects to see if they are Serializable (XML)

So, what should my tests check to pass when a custom exception is serializable?

What are the least requirements to have to say that a custom exception is serializable?

like image 378
pencilCake Avatar asked Oct 14 '22 19:10

pencilCake


1 Answers

You can check if all your exception classes implement the IXmlSerializable interface:

Assert.IsTrue(yourExceptionInstance is IXmlSerializable);
like image 181
Frédéric Hamidi Avatar answered Nov 15 '22 08:11

Frédéric Hamidi