Exemple #1
0
        /// <summary>
        /// Create an <see cref="INodeServices"/> instance according to the supplied options.
        /// </summary>
        /// <param name="options">Options for creating the <see cref="INodeServices"/> instance.</param>
        /// <returns>An <see cref="INodeServices"/> instance.</returns>
        public static INodeServices CreateNodeServices(NodeServicesOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            return(new NodeServicesImpl(options.NodeInstanceFactory));
        }
Exemple #2
0
        public NodeServicesTest()
        {
            // In typical ASP.NET Core applications, INodeServices is made available
            // through DI using services.AddNodeServices(). But for these tests we
            // create our own INodeServices instance manually, since the tests are
            // not about DI (and we might want different config for each test).
            var serviceProvider = new ServiceCollection().BuildServiceProvider();
            var options         = new NodeServicesOptions(serviceProvider);

            _nodeServices = NodeServicesFactory.CreateNodeServices(options);
        }