/// <summary>
		/// Adds the specified error id.
		/// </summary>
		/// <param name="errorId">The error id.</param>
		/// <param name="errorGravity">The error gravity.</param>
		/// <param name="args">The args (used with the error id translation).</param>
		public void Add(ErrorIdList errorId, ErrorGravity errorGravity, string[] args = null)
		{
			this.Add(new ErrorDescription { Id = errorId, Gravity = errorGravity, Args = args, StackTrace = GetCurrentStackTrace() });
		}
Example #2
0
		/// <summary>Checks the error.</summary>
		/// <param name="errorTracking" >The error tracking.</param>
		/// <param name="error" >The error.</param>
		/// <param name="errorGravity" >The error gravity.</param>
		/// <param name="errorPosition" >The error position.</param>
		public static void CheckError(Mock<ErrorTracking> errorTracking, ErrorIdList error, ErrorGravity errorGravity = ErrorGravity.Error, int errorPosition = 0)
		{
			Assert.Equal(error, errorTracking.Object.Errors[errorPosition].Id);
			Assert.Equal(errorGravity, errorTracking.Object.Errors[errorPosition].Gravity);
		}
		/// <summary>
		/// Adds the specified error id.
		/// </summary>
		/// <param name="errorId">The error id.</param>
		/// <param name="errorGravity">The error gravity.</param>
		/// <param name="exception">The exception.</param>
		/// <param name="args">The args.</param>
		public void Add(ErrorIdList errorId, ErrorGravity errorGravity, Exception exception, string[] args = null)
		{
			this.Add(new ErrorDescription { Id = errorId, Gravity = errorGravity, ExceptionMessage = exception.Message, StackTrace = exception.StackTrace, Args = args });
		}