Esempio n. 1
0
        public static IXabarilBuilder AddXabaril(this IServiceCollection serviceCollection)
        {
            var builder = new XabarilBuilder(serviceCollection);

            builder.Services.TryAdd(new ServiceCollection()
                                    .AddOutOfBoxServices());

            return(builder);
        }
        public void configure_required_services()
        {
            var serviceCollection = new ServiceCollection();

            serviceCollection.AddLogging();

            IXabarilBuilder xabarilBuilder = new XabarilBuilder(serviceCollection);

            xabarilBuilder = xabarilBuilder.AddXabarilInMemoryStore();

            var serviceProvider = serviceCollection.BuildServiceProvider();

            serviceProvider
            .GetRequiredService <IFeaturesStore>()
            .Should().NotBeNull();

            serviceProvider
            .GetRequiredService <IFeaturesStore>()
            .Should().BeOfType <InMemoryFeaturesStore>();
        }
Esempio n. 3
0
        public void configure_required_services()
        {
            var serviceCollection = new ServiceCollection();

            serviceCollection.AddLogging();

            var builder = new XabarilBuilder(serviceCollection);

            builder.AddRedisStore();

            var serviceProvider = builder.Services.BuildServiceProvider();

            serviceProvider
            .GetRequiredService <IFeaturesStore>()
            .Should().NotBeNull();

            serviceProvider
            .GetRequiredService <IFeaturesStore>()
            .Should().BeOfType <RedisFeaturesStore>();
        }