예제 #1
0
        public void ServiceReturnedNoInformationExceptionConstructorTest4()
        {
            string errorMessage = "This is an error message.";
            ServiceReturnedNoInformationException target = new ServiceReturnedNoInformationException(errorMessage);

            Assert.AreEqual(target.Message, errorMessage);
        }
예제 #2
0
        public void ServiceReturnedNoInformationExceptionConstructorTest3()
        {
            string message = "There was no response from the service.";
            ServiceReturnedNoInformationException target = new ServiceReturnedNoInformationException();

            Assert.AreEqual(target.Message, message);
        }
예제 #3
0
        public void ServiceReturnedNoInformationExceptionConstructorTest5()
        {
            string errorMessage = "This is an error message.";

            System.Exception innerException = new ArgumentNullException();
            ServiceReturnedNoInformationException target = new ServiceReturnedNoInformationException(errorMessage, innerException);

            Assert.AreEqual(target.Message, errorMessage);
            Assert.ReferenceEquals(target.InnerException, innerException);
        }
예제 #4
0
        public void ServiceReturnedNoInformationExceptionConstructorTest()
        {
            string errorMessage = "Unauthorized";
            string errorCode    = "401";
            string source       = "Intuit.Ipp.Test";
            ServiceReturnedNoInformationException target = new ServiceReturnedNoInformationException(errorMessage, errorCode, source);

            Assert.AreEqual(target.Message, errorMessage);
            Assert.AreEqual(target.ErrorCode, errorCode);
            Assert.AreEqual(target.Source, source);
        }
예제 #5
0
        public void ServiceReturnedNoInformationExceptionConstructorTest1()
        {
            string errorMessage = "Unauthorized";
            string errorCode    = "401";
            string source       = "Intuit.Ipp.Test";

            System.Exception innerException = new ArgumentNullException();
            ServiceReturnedNoInformationException target = new ServiceReturnedNoInformationException(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 ServiceReturnedNoInformationExceptionConstructorTest2()
        {
            string errorMessage = "Unauthorized";
            string errorCode    = "401";
            string source       = "Intuit.Ipp.Test";

            System.Exception innerException = new ArgumentNullException();
            ServiceReturnedNoInformationException target    = new ServiceReturnedNoInformationException(errorMessage, errorCode, source, innerException);
            ServiceReturnedNoInformationException newTarget = null;

            using (Stream s = new MemoryStream())
            {
                BinaryFormatter formatter = new BinaryFormatter();
                formatter.Serialize(s, target);
                s.Position = 0; // Reset stream position
                newTarget  = (ServiceReturnedNoInformationException)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);
        }