public ExecuteHttpTriggerTests() { _request = new DefaultHttpRequest(new DefaultHttpContext()); _request.Headers.Add("X-Forwarded-Host", "test.com"); _executionContext = new ExecutionContext(); _config = A.Fake <IOptionsMonitor <ServiceTaxonomyApiSettings> >(); A.CallTo(() => _config.CurrentValue).Returns(new ServiceTaxonomyApiSettings { Function = DefaultFunctionName, Neo4jUrl = "bolt://localhost:11002", Neo4jUser = "******", Neo4jPassword = "******", Scheme = "https://", ApplicationName = "ServiceTaxonomy" }); _log = A.Fake <ILogger>(); _httpRequestHelper = A.Fake <IHttpRequestHelper>(); _neo4JHelper = A.Fake <INeo4JHelper>(); _fileHelper = A.Fake <IFileHelper>(); _resultSummary = A.Fake <IResultSummary>(); A.CallTo(() => _neo4JHelper.GetResultSummaryAsync()).Returns(_resultSummary); const string query = "{\"query\": \"QUERY HERE\"}"; A.CallTo(() => _fileHelper.ReadAllTextFromFileAsync($"\\CypherQueries\\{DefaultApiVersion}\\{DefaultFunctionName}.json")).Returns(query); _executeFunction = new Execute(_config, _httpRequestHelper, _neo4JHelper, _fileHelper); }
public Execute(IOptionsMonitor <ServiceTaxonomyApiSettings> serviceTaxonomyApiSettings, IHttpRequestHelper httpRequestHelper, INeo4JHelper neo4JHelper, IFileHelper fileHelper) { _serviceTaxonomyApiSettings = serviceTaxonomyApiSettings ?? throw new ArgumentNullException(nameof(serviceTaxonomyApiSettings)); _httpRequestHelper = httpRequestHelper ?? throw new ArgumentNullException(nameof(httpRequestHelper)); _neo4JHelper = neo4JHelper ?? throw new ArgumentNullException(nameof(neo4JHelper)); _fileHelper = fileHelper ?? throw new ArgumentNullException(nameof(fileHelper)); }