/// <summary>
 /// Initializes a new instance with a specified formatted error message and a reference to the 
 /// inner exception that is the cause of this exception. 
 /// </summary>
 /// <param name="category">Category of error.</param>
 /// <param name="code">Error code.</param>
 /// <param name="format">The format message that describes the error</param>
 /// <param name="inner">The exception that is the cause of the current exception</param>
 /// <param name="args">The arguments to the format string</param>
 internal ShardManagementException(ShardManagementErrorCategory category, ShardManagementErrorCode code, string format, Exception inner, params object[] args)
     : base(string.Format(CultureInfo.InvariantCulture, format, args), inner)
 {
     this.ErrorCategory = category;
     this.ErrorCode = code;
 }
 /// <summary>
 /// Initializes a new instance with a specified error message and a reference to the inner exception 
 /// that is the cause of this exception.
 /// </summary>
 /// <param name="category">Category of error.</param>
 /// <param name="code">Error code.</param>
 /// <param name="message">A message that describes the error</param>
 /// <param name="inner">The exception that is the cause of the current exception</param>
 internal ShardManagementException(ShardManagementErrorCategory category, ShardManagementErrorCode code, string message, Exception inner)
     : base(message, inner)
 {
     this.ErrorCategory = category;
     this.ErrorCode = code;
 }
 /// <summary>
 /// Initializes a new instance with a specified error message and a reference to the inner exception
 /// that is the cause of this exception.
 /// </summary>
 /// <param name="category">Category of error.</param>
 /// <param name="code">Error code.</param>
 /// <param name="message">A message that describes the error</param>
 /// <param name="inner">The exception that is the cause of the current exception</param>
 internal ShardManagementException(ShardManagementErrorCategory category, ShardManagementErrorCode code, string message, Exception inner)
     : base(message, inner)
 {
     this.ErrorCategory = category;
     this.ErrorCode     = code;
 }
 /// <summary>
 /// Initializes a new instance with a specified formatted error message and a reference to the
 /// inner exception that is the cause of this exception.
 /// </summary>
 /// <param name="category">Category of error.</param>
 /// <param name="code">Error code.</param>
 /// <param name="format">The format message that describes the error</param>
 /// <param name="inner">The exception that is the cause of the current exception</param>
 /// <param name="args">The arguments to the format string</param>
 internal ShardManagementException(ShardManagementErrorCategory category, ShardManagementErrorCode code, string format, Exception inner, params object[] args)
     : base(string.Format(CultureInfo.InvariantCulture, format, args), inner)
 {
     this.ErrorCategory = category;
     this.ErrorCode     = code;
 }
Exemplo n.º 5
0
        protected void AssertThrowsShardManagementException(Action a, ShardManagementErrorCode expectedCode)
        {
            ShardManagementException smme = Assert.ThrowsException <ShardManagementException>(a);

            Assert.AreEqual(ShardManagementErrorCode.MappingNotFoundForKey, smme.ErrorCode);
        }