public void FindDefaultFunctionType_TypedCloudEventFunction()
        {
            var expected = typeof(StorageCloudEventFunction);
            var actual   = HostingInternals.FindDefaultFunctionType(typeof(StorageCloudEventFunction));

            Assert.Equal(expected, actual);
        }
 public void FindDefaultFunctionType_NoFunctionTypes() =>
 Assert.Throws <ArgumentException>(() => HostingInternals.FindDefaultFunctionType(
                                       typeof(FunctionTargetTest),
                                       typeof(FunctionsEnvironmentVariablesConfigurationSourceTest),
                                       typeof(AbstractHttpFunction), // Abstract, doesn't count
                                       typeof(INamedHttpFunction)    // Interface, doesn't count
                                       ));
        public void FindDefaultFunctionType_SingleFunctionType()
        {
            var expected = typeof(DefaultFunction);
            var actual   = HostingInternals.FindDefaultFunctionType(
                typeof(FunctionTargetTest),
                typeof(FunctionsEnvironmentVariablesConfigurationSourceTest),
                typeof(AbstractHttpFunction), // Abstract, doesn't count
                typeof(INamedHttpFunction),   // Interface, doesn't count
                typeof(DefaultFunction));

            Assert.Equal(expected, actual);
        }
 public void FindDefaultFunctionType_MultipleCloudEventTypesFunction() =>
 Assert.Throws <ArgumentException>(() => HostingInternals.FindDefaultFunctionType(
                                       typeof(MultipleCloudEventTypes)));
 public void FindDefaultFunctionType_MultipleFunctionTypes() =>
 Assert.Throws <ArgumentException>(() => HostingInternals.FindDefaultFunctionType(
                                       typeof(DefaultFunction),
                                       typeof(EventIdRememberingFunction)));