다음을 통해 공유


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

속성

이름 설명 유형 필수
유형 추가 오류 정보에 대한 형식입니다. 문자열 아니오
정보 추가 정보 JToken 아니오