public async Task GivenIUseTheOperationsControlClientToSetTheStatusOfTheOperationWithIdCalledToFailed(string operationIdName)
        {
            Guid id = this.ScenarioContext.Get <Guid>(operationIdName);

            IServiceProvider         serviceProvider = ContainerBindings.GetServiceProvider(this.FeatureContext);
            IMarainOperationsControl client          = serviceProvider.GetRequiredService <IMarainOperationsControl>();
            var transientTenantManager = TransientTenantManager.GetInstance(this.FeatureContext);

            await Exceptions.ExecuteAndStoreExceptionAsync(
                this.ScenarioContext,
                async() =>
            {
                ProblemDetails?result = await client.SetOperationFailedAsync(
                    transientTenantManager.PrimaryTransientClient.Id,
                    id).ConfigureAwait(false);

                this.ScenarioContext.Set(result);
            }).ConfigureAwait(false);
        }
Exemple #2
0
 /// <summary>
 /// Set an existing operation into the "Failed" state
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='tenantId'>
 /// Id of the Tenant.
 /// </param>
 /// <param name='operationId'>
 /// Id of the Operation.
 /// </param>
 /// <param name='expireAfter'>
 /// Optional number of seconds for which to retain data about this operation
 /// after its last state change
 /// </param>
 /// <param name='body'>
 /// </param>
 public static ProblemDetails SetOperationFailed(this IMarainOperationsControl operations, string tenantId, System.Guid operationId, long?expireAfter = default(long?), string body = default(string))
 {
     return(operations.SetOperationFailedAsync(tenantId, operationId, expireAfter, body).GetAwaiter().GetResult());
 }