Class TestOrchestrationMetadataBuilder
- Namespace
- XBullet.EasyTesting.AzureFunctions
- Assembly
- XBullet.EasyTesting.AzureFunctions.dll
Builds SDK metadata fixtures with readable typed payloads and deterministic timestamps.
public sealed class TestOrchestrationMetadataBuilder
- Inheritance
-
TestOrchestrationMetadataBuilder
- Inherited Members
- Extension Methods
Constructors
TestOrchestrationMetadataBuilder(string, string)
Creates a pending-instance fixture.
public TestOrchestrationMetadataBuilder(string orchestrationName, string instanceId)
Parameters
orchestrationNamestringThe non-empty orchestration name.
instanceIdstringThe non-empty instance ID.
Methods
Build()
Creates a fresh SDK metadata snapshot, serializing configured payloads.
public OrchestrationMetadata Build()
Returns
- OrchestrationMetadata
Metadata with typed payload readers enabled, including when payloads are absent.
WithCustomStatus<T>(T)
Sets custom status serialized when Build is called.
public TestOrchestrationMetadataBuilder WithCustomStatus<T>(T status)
Parameters
statusTThe original status reference; null clears custom status.
Returns
- TestOrchestrationMetadataBuilder
This builder for chaining.
Type Parameters
TThe status value type.
WithDataConverter(DataConverter)
Sets the payload converter, also used by the built metadata's typed readers.
public TestOrchestrationMetadataBuilder WithDataConverter(DataConverter converter)
Parameters
converterDataConverterThe non-null caller-owned converter. Defaults to the SDK JSON converter.
Returns
- TestOrchestrationMetadataBuilder
This builder for chaining. The converter is used for all payloads at Build time.
WithFailure(TaskFailureDetails)
Sets failure details and the Failed runtime status.
public TestOrchestrationMetadataBuilder WithFailure(TaskFailureDetails failure)
Parameters
failureTaskFailureDetailsThe non-null SDK failure descriptor retained by reference.
Returns
- TestOrchestrationMetadataBuilder
This builder for chaining.
WithFailure(Exception)
Creates SDK failure details from an exception and sets Failed status.
public TestOrchestrationMetadataBuilder WithFailure(Exception exception)
Parameters
exceptionExceptionThe non-null exception whose details may include sensitive text and stack traces.
Returns
- TestOrchestrationMetadataBuilder
This builder for chaining.
WithInput<T>(T)
Sets input serialized when Build is called.
public TestOrchestrationMetadataBuilder WithInput<T>(T input)
Parameters
inputTThe original input reference; null clears input.
Returns
- TestOrchestrationMetadataBuilder
This builder for chaining.
Type Parameters
TThe input type.
WithOutput<T>(T)
Sets output serialized when Build is called.
public TestOrchestrationMetadataBuilder WithOutput<T>(T output)
Parameters
outputTThe original output reference; null clears output.
Returns
- TestOrchestrationMetadataBuilder
This builder for chaining.
Type Parameters
TThe output type.
WithRuntimeStatus(OrchestrationRuntimeStatus)
Sets a defined SDK runtime status.
public TestOrchestrationMetadataBuilder WithRuntimeStatus(OrchestrationRuntimeStatus status)
Parameters
statusOrchestrationRuntimeStatusThe status to report. Choosing a non-failed status clears failure details.
Returns
- TestOrchestrationMetadataBuilder
This builder for chaining.
WithTags(IReadOnlyDictionary<string, string>)
Copies tags using case-sensitive ordinal keys.
public TestOrchestrationMetadataBuilder WithTags(IReadOnlyDictionary<string, string> tags)
Parameters
tagsIReadOnlyDictionary<string, string>The non-null tags to copy. Defaults to empty.
Returns
- TestOrchestrationMetadataBuilder
This builder for chaining.
WithTimestamps(DateTimeOffset, DateTimeOffset)
Sets creation and update times, normalized to UTC.
public TestOrchestrationMetadataBuilder WithTimestamps(DateTimeOffset createdAt, DateTimeOffset lastUpdatedAt)
Parameters
createdAtDateTimeOffsetThe creation time. Defaults to Unix epoch.
lastUpdatedAtDateTimeOffsetThe update time, which must not precede creation. Defaults to Unix epoch.
Returns
- TestOrchestrationMetadataBuilder
This builder for chaining.