示例#1
0
        public void SerializationExceptionConstructorTest4()
        {
            string errorMessage = "This is an error message.";

            Intuit.Ipp.Exception.SerializationException target = new Intuit.Ipp.Exception.SerializationException(errorMessage);
            Assert.AreEqual(target.Message, errorMessage);
        }
示例#2
0
        public void SerializationExceptionConstructorTest3()
        {
            string message = "Serialization Exception was raised.";

            Intuit.Ipp.Exception.SerializationException target = new Intuit.Ipp.Exception.SerializationException();
            Assert.AreEqual(target.Message, message);
        }
示例#3
0
        public void SerializationExceptionConstructorTest5()
        {
            string errorMessage = "This is an error message.";

            System.Exception innerException = new ArgumentNullException();
            Intuit.Ipp.Exception.SerializationException target = new Intuit.Ipp.Exception.SerializationException(errorMessage, innerException);
            Assert.AreEqual(target.Message, errorMessage);
            Assert.ReferenceEquals(target.InnerException, innerException);
        }
示例#4
0
        public void SerializationExceptionConstructorTest()
        {
            string errorMessage = "Unauthorized";
            string errorCode    = "401";
            string source       = "Intuit.Ipp.Test";

            Intuit.Ipp.Exception.SerializationException target = new Intuit.Ipp.Exception.SerializationException(errorMessage, errorCode, source);
            Assert.AreEqual(target.Message, errorMessage);
            Assert.AreEqual(target.ErrorCode, errorCode);
            Assert.AreEqual(target.Source, source);
        }
示例#5
0
        public void SerializationExceptionConstructorTest1()
        {
            string errorMessage = "Unauthorized";
            string errorCode    = "401";
            string source       = "Intuit.Ipp.Test";

            System.Exception innerException = new ArgumentNullException();
            Intuit.Ipp.Exception.SerializationException target = new Intuit.Ipp.Exception.SerializationException(errorMessage, errorCode, source, innerException);
            Assert.AreEqual(target.Message, errorMessage);
            Assert.AreEqual(target.ErrorCode, errorCode);
            Assert.AreEqual(target.Source, source);
            Assert.ReferenceEquals(target.InnerException, innerException);
        }
示例#6
0
        public void SerializationExceptionConstructorTest2()
        {
            string errorMessage = "Unauthorized";
            string errorCode    = "401";
            string source       = "Intuit.Ipp.Test";

            System.Exception innerException = new ArgumentNullException();
            Intuit.Ipp.Exception.SerializationException target    = new Intuit.Ipp.Exception.SerializationException(errorMessage, errorCode, source, innerException);
            Intuit.Ipp.Exception.SerializationException newTarget = null;
            using (Stream s = new MemoryStream())
            {
                BinaryFormatter formatter = new BinaryFormatter();
                formatter.Serialize(s, target);
                s.Position = 0; // Reset stream position
                newTarget  = (Intuit.Ipp.Exception.SerializationException)formatter.Deserialize(s);
            }

            Assert.IsNotNull(newTarget);
            Assert.AreEqual(newTarget.Message, errorMessage);
            Assert.AreEqual(newTarget.ErrorCode, errorCode);
            Assert.AreEqual(newTarget.Source, source);
            Assert.ReferenceEquals(newTarget.InnerException, innerException);
        }