Skip to content

Commit

Permalink
Configure options
Browse files Browse the repository at this point in the history
  • Loading branch information
liliankasem committed Oct 16, 2024
1 parent b2626f8 commit 92b8666
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -40,7 +39,7 @@ public class ProxyFunctionDescriptorProviderTests : IAsyncLifetime, IDisposable

public ProxyFunctionDescriptorProviderTests()
{
string rootPath = Path.Combine(Environment.CurrentDirectory, @"TestScripts\Proxies");
string rootPath = Path.Combine(Environment.CurrentDirectory, "TestScripts", "Proxies");

var hostOptions = new JobHostOptions();
var eventManager = new Mock<IScriptEventManager>();
Expand Down Expand Up @@ -183,17 +182,17 @@ public void Dispose()

private void AddProxyProvider(IServiceCollection services, string rootPath)
{
var jobHostOptions = new ScriptJobHostOptions
{
RootLogPath = rootPath,
RootScriptPath = rootPath
};
var jobHostOptionsWrapped = new OptionsWrapper<ScriptJobHostOptions>(jobHostOptions);
var nullLogger = new NullLoggerFactory();
var env = new TestEnvironment(new Dictionary<string, string>
{
{ EnvironmentSettingNames.AzureWebJobsFeatureFlags, ScriptConstants.FeatureFlagEnableProxies },
});

var jobHostOptions = TestUtils.GetConfiguredOptions(new Dictionary<string, string>(), env);
jobHostOptions.RootLogPath = rootPath;
jobHostOptions.RootScriptPath = rootPath;
var jobHostOptionsWrapped = new OptionsWrapper<ScriptJobHostOptions>(jobHostOptions);

var proxyMetadataProvider = new ProxyFunctionProvider(jobHostOptionsWrapped, env, new Mock<IScriptEventManager>().Object, nullLogger);
var functionMetadataManager = TestFunctionMetadataManager.GetFunctionMetadataManager(jobHostOptionsWrapped, new Mock<IFunctionMetadataProvider>().Object,
new List<IFunctionProvider>() { proxyMetadataProvider }, new OptionsWrapper<HttpWorkerOptions>(new HttpWorkerOptions()), nullLogger, new TestOptionsMonitor<LanguageWorkerOptions>(TestHelpers.GetTestLanguageWorkerOptions()));
Expand Down

0 comments on commit 92b8666

Please sign in to comment.