你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

TestErrorResponseAdditionalInfo 类

命名空间: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