Edit

Share via


TestErrorResponseAdditionalInfo class

Namespace: Microsoft.Azure.Workflows.UnitTesting.ErrorResponses

This class provides more contextual information for the error responses in workflow testing scenarios. The information schema is service-specific and dependent on the Type string.

Usage

// 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 }
);

Properties

Name Description Type Required
Type The type for the additional error info string No
Info The additional information JToken No