public void TestCtorMessageInner_Valid()
        {
            Exception e = new FinancialSecurityException(message, cause);

            Assert.AreEqual(message, e.Message, "e.Message should be equal to message.");
            Assert.AreEqual(cause, e.InnerException, "e.InnerException should be equal to cause.");
        }
        public void TestCtorInfoContext()
        {
            // Stream for serialization.
            using (Stream stream = new MemoryStream())
            {
                // Serialize the instance.
                FinancialSecurityException serial =
                    new FinancialSecurityException(message, cause);
                BinaryFormatter formatter = new BinaryFormatter();
                formatter.Serialize(stream, serial);

                // Deserialize the instance.
                stream.Seek(0, SeekOrigin.Begin);
                FinancialSecurityException deserial =
                    formatter.Deserialize(stream) as FinancialSecurityException;

                // Verify the instance.
                Assert.IsFalse(serial == deserial, "Instance not deserialized.");
                Assert.AreEqual(serial.Message, deserial.Message, "Message mismatches.");
                Assert.AreEqual(serial.InnerException.Message, deserial.InnerException.Message,
                                "InnerException mismatches.");
            }
        }
        public void TestCtorMessageInner_Null2()
        {
            Exception e = new FinancialSecurityException(null, cause);

            Assert.AreEqual(cause, e.InnerException, "e.InnerException should be equal to cause.");
        }
        public void TestCtorMessageInner_Null1()
        {
            Exception e = new FinancialSecurityException(message, null);

            Assert.AreEqual(message, e.Message, "e.Message should be equal to message.");
        }
        public void TestCtorMessage_Valid()
        {
            Exception e = new FinancialSecurityException(message);

            Assert.AreEqual(message, e.Message, "e.Message should be equal to message.");
        }