Esempio n. 1
0
        public DefaultFunctionExecutionContextTests()
        {
            IServiceCollection serviceCollection = new ServiceCollection();

            serviceCollection.AddSingleton <SingletonService>();
            serviceCollection.AddTransient <TransientService>();
            serviceCollection.AddScoped <ScopedService>();
            _serviceProvider     = serviceCollection.BuildServiceProvider();
            _serviceScopeFactory = _serviceProvider.GetService <IServiceScopeFactory>();

            var invocation = new Mock <FunctionInvocation>(MockBehavior.Strict).Object;
            var definition = new Mock <FunctionDefinition>(MockBehavior.Strict).Object;

            _defaultFunctionExecutionContext = new DefaultFunctionExecutionContext(_serviceScopeFactory, invocation, definition);
        }
Esempio n. 2
0
        public FunctionExecutionContext Create(FunctionInvocation invocation, FunctionDefinition definition)
        {
            var context = new DefaultFunctionExecutionContext(_serviceScopeFactory, invocation, definition);

            return(context);
        }