你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
命名空间:Microsoft.Azure.Workflows.UnitTesting.ErrorResponses
此类为工作流测试方案中的错误响应提供了更多上下文信息。 信息架构特定于服务,依赖于 类型 字符串。
用法
// The request ID for the additional info
var requestIdInfo = new TestErrorResponseAdditionalInfo
{
Type = "RequestId",
Info = JToken.FromObject("req-abc123")
};
// The timestamp for the additional info
var timestampInfo = new TestErrorResponseAdditionalInfo
{
Type = "Timestamp",
Info = JToken.FromObject(DateTime.UtcNow)
};
// Complex additional info with nested data
var complexInfo = new TestErrorResponseAdditionalInfo
{
Type = "ValidationDetails",
Info = JToken.Parse(@"{
""field"": ""email"",
""providedValue"": ""invalid-email"",
""expectedFormat"": ""user@domain.com""
}")
};
// Use in error context
var error = new TestErrorInfo(
ErrorResponseCode.BadRequest,
"Validation failed",
null,
new[] { requestIdInfo, timestampInfo }
);
性能
名称 | DESCRIPTION | 类型 | 必选 |
---|---|---|---|
类型 | 其他错误信息的类型 | 字符串 | 否 |
信息 | 其他信息 | JToken | 否 |
相关内容
- ActionMock 类定义
- TriggerMock 类定义
- TestActionExecutionContext 类定义
- TestExecutionContext 类定义
- TestIterationItem 类定义
- TestWorkflowRun 类定义
- TestErrorInfo 类定义
- TestWorkflowOutputParameter 类定义
- TestWorkflowRunActionRepetitionResult 类定义
- TestWorkflowRunActionResult 类定义
- TestWorkflowRunTriggerResult 类定义
- TestWorkflowStatus 枚举定义
- UnitTestExecutor 类定义