Freigeben über


TestExecutionContext-Klasse

Namespace: Microsoft.Azure.Workflows.UnitTesting.Definitions

Diese Klasse stellt den Ausführungskontext für einen Komponententest bereit, der für Standardworkflowtests in Azure Logic Apps mit einem Mandanten verwendet wird. Die Klasse hilft beim Verwalten des Zustands während der Testausführung und ist nützlich, wenn Sie dynamische Modelle erstellen möchten, die je nach dem aktuellen Workflowstatus unterschiedlich reagieren.

Verwendung

var actionMock = new CallExternalSystemsActionMock(name: "Call_External_Systems", onGetActionMock: (testExecutionContext) =>
{
    return new CallExternalSystemsActionMock(
        status: TestWorkflowStatus.Succeeded,
        outputs: new CallExternalSystemsActionOutput {
            Body = new JObject
            {
                { "name", testExecutionContext.ActionContext.ActionName },
                { "inputs", testExecutionContext.ActionContext.ActionInputs },
                { "scope", testExecutionContext.ActionContext.ParentActionName },
                { "iteration", testExecutionContext.ActionContext.CurrentIterationInput.Index }
            }
        }
    );
});

Eigenschaften

Name BESCHREIBUNG Typ Erforderlich
ActionContext Ruft den aktuellen Aktionskontext ab. TestActionExecutionContext Ja