/// <summary> /// Initializes a new instance of the <see cref="CSF.Zpt.BatchRendering.BatchRenderingException"/> class. /// </summary> /// <param name="message">A <see cref="T:System.String"/> that describes the exception.</param> /// <param name="fatalError">A value indicating the nature of a fatal error.</param> /// <param name="inner">The exception that is the cause of the current exception.</param> public BatchRenderingException(string message, BatchRenderingFatalErrorType fatalError, Exception inner) : base(message, inner) { this.FatalError = fatalError; }
/// <summary> /// Initializes a new instance of the <see cref="CSF.Zpt.BatchRendering.BatchRenderingResponse"/> class. /// </summary> /// <param name="fatalError">Fatal error.</param> /// <param name="documents">Documents.</param> private BatchRenderingResponse(BatchRenderingFatalErrorType? fatalError, IEnumerable<IBatchRenderingDocumentResponse> documents) { if(fatalError.HasValue && !fatalError.Value.IsDefinedValue()) { throw new ArgumentException(Resources.ExceptionMessages.FatalErrorTypeMustBeDefined, nameof(fatalError)); } this.Documents = documents?? new IBatchRenderingDocumentResponse[0]; this.FatalError = fatalError; }
private void ExerciseSut(BatchRenderingFatalErrorType? expectedErrorType) { try { _sut.Validate(_options.Object); } catch(InvalidBatchRenderingOptionsException ex) { Assert.AreEqual(expectedErrorType, ex.FatalError, "Correct error type"); throw; } }
/// <summary> /// Initializes a new instance of the <see cref="CSF.Zpt.BatchRendering.InvalidBatchRenderingOptionsException"/> class. /// </summary> /// <param name="message">A <see cref="T:System.String"/> that describes the exception.</param> /// <param name="fatalError">A value indicating the nature of a fatal error.</param> public InvalidBatchRenderingOptionsException(string message, BatchRenderingFatalErrorType fatalError) : base(message, fatalError) { }
/// <summary> /// Initializes a new instance of the <see cref="CSF.Zpt.BatchRendering.BatchRenderingException"/> class. /// </summary> /// <param name="message">A <see cref="T:System.String"/> that describes the exception.</param> /// <param name="fatalError">A value indicating the nature of a fatal error.</param> public BatchRenderingException(string message, BatchRenderingFatalErrorType fatalError) : this(message, fatalError, null) { }
/// <summary> /// Initializes a new instance of the <see cref="CSF.Zpt.BatchRendering.BatchRenderingResponse"/> class. /// </summary> /// <param name="fatalError">The nature of a fatal error.</param> public BatchRenderingResponse(BatchRenderingFatalErrorType fatalError) : this(fatalError, null) { }