/// <summary>
        /// Validates the exception object.
        /// </summary>
        /// <param name="exceptionObject">The exception object.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">exceptionObject</exception>
        private static CloudFoundryExceptionObject ValidateExceptionObject(CloudFoundryExceptionObject exceptionObject)
        {
            if (exceptionObject == null)
            {
                throw new ArgumentNullException("exceptionObject");
            }

            return(exceptionObject);
        }
        /// <summary>
        /// Validates the exception object.
        /// </summary>
        /// <param name="exceptionObject">The exception object.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">exceptionObject</exception>
        private static CloudFoundryExceptionObject ValidateExceptionObject(CloudFoundryExceptionObject exceptionObject)
        {
            if (exceptionObject == null)
            {
                throw new ArgumentNullException("exceptionObject");
            }

            return exceptionObject;
        }
        public void TestException()
        {
            CloudFoundryExceptionObject exceptionObject = new CloudFoundryExceptionObject();
            exceptionObject.Code = "object";
            exceptionObject.Description = "this is an exception";
            exceptionObject.ErrorCode = "errorCode";

            CloudFoundryException exception = new CloudFoundryException(exceptionObject);

            Assert.AreEqual(exception.Message, "this is an exception");
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CloudFoundryException"/> class.
 /// </summary>
 /// <param name="exceptionObject">The exception object.</param>
 public CloudFoundryException(CloudFoundryExceptionObject exceptionObject)
     : base(ValidateExceptionObject(exceptionObject).Description)
 {
     this.ExceptionObject = exceptionObject;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CloudFoundryException"/> class.
 /// </summary>
 /// <param name="exceptionObject">The exception object.</param>
 public CloudFoundryException(CloudFoundryExceptionObject exceptionObject)
     : base(ValidateExceptionObject(exceptionObject).Description)
 {
     this.ExceptionObject = exceptionObject;
 }