Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Namespace: Microsoft.Azure.Workflows.UnitTesting.ErrorResponses
This class provides extended and detailed error information for Standard logic app workflow testing scenarios, including error codes, messages, nested error details, and other contextual information.
Usage
// Simple error
var basicError = new TestErrorInfo(
ErrorResponseCode.BadRequest,
"Invalid input parameter"
);
// Nested errors with additional info
var detailError1 = new TestErrorInfo(
ErrorResponseCode.ValidationError,
"Field 'email' is required"
);
var detailError2 = new TestErrorInfo(
ErrorResponseCode.ValidationError,
"Field 'age' must be a positive number"
);
var additionalInfo = new TestErrorResponseAdditionalInfo[]
{
new TestErrorResponseAdditionalInfo
{
Type = "RequestId",
Info = JToken.FromObject("req-12345")
}
};
var complexError = new TestErrorInfo(
ErrorResponseCode.BadRequest,
"Request validation failed",
new[] { detailError1, detailError2 },
additionalInfo
);
Constructors
Primary constructor
Creates a new instance of the TestErrorInfo
class.
public TestErrorInfo(ErrorResponseCode code, string message, TestErrorInfo[] details = null, TestErrorResponseAdditionalInfo[] additionalInfo = null)
Name | Description | Type | Required |
---|---|---|---|
code | The error code | ErrorResponseCode | Yes |
message | The error message | string | Yes |
details | The detailed error message details | TestErrorInfo | No |
additionalInfo | The array of additional information | TestErrorResponseAdditionalInfo | No |
// Example: Creating an error with code and message
var error = new TestErrorInfo(
ErrorResponseCode.NotFound,
"The specified resource was not found"
);
Properties
Name | Description | Type | Required |
---|---|---|---|
Code | The error code | ErrorResponseCode | Yes |
Message | The error message | string | Yes |
Details | The detailed error message details | TestErrorInfo | No |
AdditionalInfo | The array of additional information | TestErrorResponseAdditionalInfo | No |
Related content
- ActionMock Class Definition
- TriggerMock Class Definition
- TestActionExecutionContext Class Definition
- TestExecutionContext Class Definition
- TestIterationItem Class Definition
- TestWorkflowRun Class Definition
- TestErrorResponseAdditionalInfo Class Definition
- TestWorkflowOutputParameter Class Definition
- TestWorkflowRunActionRepetitionResult Class Definition
- TestWorkflowRunActionResult Class Definition
- TestWorkflowRunTriggerResult Class Definition
- TestWorkflowStatus Enum Definition
- UnitTestExecutor Class Definition