Ejemplo n.º 1
0
        public async Task ToFunctionMetadataResponse_WithoutFiles_ReturnsExpected()
        {
            var functionMetadata = new FunctionMetadata
            {
                Name = "TestFunction1"
            };
            var options = new ScriptJobHostOptions
            {
                RootScriptPath = _testRootScriptPath
            };

            AddSampleBindings(functionMetadata);
            var result = await functionMetadata.ToFunctionMetadataResponse(options, string.Empty, null);

            Assert.Null(result.ScriptRootPathHref);
            Assert.Null(result.ConfigHref);
            Assert.Equal("TestFunction1", result.Name);

            var binding = result.Config["bindings"] as JArray;

            Assert.Equal("httpTrigger", binding[0]["type"].Value <string>());
        }