private static IWebJobsBuilder AddDurableTask(this IWebJobsBuilder builder, IOptions <DurableTaskOptions> options, string storageProvider, Type durabilityProviderFactoryType = null)
        {
            if (durabilityProviderFactoryType != null)
            {
                builder.Services.AddSingleton(typeof(IDurabilityProviderFactory), typeof(AzureStorageShortenedTimerDurabilityProviderFactory));
                builder.AddDurableTask(options);
                return(builder);
            }

            switch (storageProvider)
            {
            case TestHelpers.RedisProviderType:
                builder.AddRedisDurableTask();
                break;

            case TestHelpers.EmulatorProviderType:
                builder.AddEmulatorDurableTask();
                break;

            case TestHelpers.AzureStorageProviderType:
                // This provider is built into the default AddDurableTask() call below.
                break;

            default:
                throw new InvalidOperationException($"The DurableTaskOptions of type {options.GetType()} is not supported for tests in Functions V2.");
            }

            builder.AddDurableTask(options);
            return(builder);
        }
        private static IWebJobsBuilder AddDurableTask(this IWebJobsBuilder builder, IOptions <DurableTaskOptions> options, string storageProvider)
        {
            switch (storageProvider)
            {
            case TestHelpers.RedisProviderType:
                builder.AddRedisDurableTask();
                break;

            case TestHelpers.EmulatorProviderType:
                builder.AddEmulatorDurableTask();
                break;

            case TestHelpers.AzureStorageProviderType:
                // This provider is built into the default AddDurableTask() call below.
                break;

            default:
                throw new InvalidOperationException($"The DurableTaskOptions of type {options.GetType()} is not supported for tests in Functions V2.");
            }

            builder.AddDurableTask(options);
            return(builder);
        }