public override bool TryCreate(FunctionMetadata functionMetadata, out FunctionDescriptor functionDescriptor)
 {
     if (functionMetadata == null)
     {
         throw new ArgumentNullException(nameof(functionMetadata));
     }
     functionDescriptor = null;
     return(_dispatcher.IsSupported(functionMetadata) &&
            base.TryCreate(functionMetadata, out functionDescriptor));
 }
Example #2
0
        public void IsSupported_Returns_False(string language, string funcMetadataLanguage)
        {
            IFunctionDispatcher functionDispatcher = GetTestFunctionDispatcher();
            FunctionMetadata    func1 = new FunctionMetadata()
            {
                Name     = "func1",
                Language = funcMetadataLanguage
            };

            Assert.False(functionDispatcher.IsSupported(func1, language));
        }
        public override async Task <(bool, FunctionDescriptor)> TryCreate(FunctionMetadata functionMetadata)
        {
            if (functionMetadata == null)
            {
                throw new ArgumentNullException(nameof(functionMetadata));
            }

            if (!_dispatcher.IsSupported(functionMetadata, _workerRuntime))
            {
                return(false, null);
            }

            return(await base.TryCreate(functionMetadata));
        }