Represents assertion errors that occur at runtime.
Наследование: Exception
Пример #1
0
        public void AssertExceptionSerializationTest()
        {
            AssertException assertException = new AssertException("message");

            MemoryStream stream = new MemoryStream();
            BinaryFormatter formatter = new BinaryFormatter();

            formatter.Serialize(stream, assertException);

            stream.Position = 0;
            AssertException newAssertException = (AssertException)formatter.Deserialize(stream);

            Assert.AreEqual(assertException.Message, newAssertException.Message);
        }