/// <summary>
 /// Initializes a new instance of the <see cref="TransferException" /> class.
 /// </summary>
 /// <param name="errorCode">Transfer error code.</param>
 /// <param name="message">Exception message.</param>
 public TransferException(
     TransferErrorCode errorCode,
     string message)
     : base(message)
 {
     this.errorCode = errorCode;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TransferException" /> class.
 /// </summary>
 /// <param name="errorCode">Transfer error code.</param>
 /// <param name="message">Exception message.</param>
 public TransferException(
     TransferErrorCode errorCode, 
     string message)
     : base(message)
 {
     this.errorCode = errorCode;
 }
        public static void VerifyTransferException(Exception exception, TransferErrorCode expectedErrorCode, params string[] expectedMessages)
        {
            TransferException transferException = exception as TransferException;
            if (transferException == null)
            {
                Test.Error("Verify exception is a transfer exception.");
                return;
            }

            Test.Assert(transferException.ErrorCode == expectedErrorCode, "Verify error code: {0}, expected: {1}", transferException.ErrorCode, expectedErrorCode);
            VerificationHelper.VerifyExceptionErrorMessage(exception, expectedMessages);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TransferException" /> class.
        /// </summary>
        /// <param name="info">Serialization information.</param>
        /// <param name="context">Streaming context.</param>
        protected TransferException(
            SerializationInfo info,
            StreamingContext context)
            : base(info, context)
        {
            int exceptionVersion = info.GetInt32(VersionFieldName);

            if (exceptionVersion >= 1)
            {
                this.errorCode = (TransferErrorCode)info.GetInt32(ErrorCodeFieldName);
            }
        }
예제 #5
0
        public static void VerifyTransferException(Exception exception, TransferErrorCode expectedErrorCode, params string[] expectedMessages)
        {
            TransferException transferException = exception as TransferException;

            if (transferException == null)
            {
                Test.Error("Verify exception is a transfer exception.");
                return;
            }

            Test.Assert(transferException.ErrorCode == expectedErrorCode, "Verify error code: {0}, expected: {1}", transferException.ErrorCode, expectedErrorCode);
            VerificationHelper.VerifyExceptionErrorMessage(exception, expectedMessages);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TransferException" /> class.
 /// </summary>
 /// <param name="errorCode">Transfer error code.</param>
 public TransferException(TransferErrorCode errorCode)
 {
     this.errorCode = errorCode;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TransferException" /> class.
 /// </summary>
 /// <param name="errorCode">Transfer error code.</param>
 public TransferException(TransferErrorCode errorCode)
 {
     this.errorCode = errorCode;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="TransferException" /> class.
        /// </summary>
        /// <param name="info">Serialization information.</param>
        /// <param name="context">Streaming context.</param>
        private TransferException(
            SerializationInfo info, 
            StreamingContext context)
            : base(info, context)
        {
            int exceptionVersion = info.GetInt32(VersionFieldName);

            if (exceptionVersion >= 1)
            {
                this.errorCode = (TransferErrorCode)info.GetInt32(ErrorCodeFieldName);
            }
        }