Beispiel #1
0
        public void TestingServiceCollectionExtensions_ShouldPass()
        {
            var databaseConfiguration = new DatabaseConfiguration {
                ConnectionString = "Hello World!!!"
            };
            var serviceCollection = new Microsoft.Extensions.DependencyInjection.ServiceCollection();
            var serviceProvider   = serviceCollection.BuildServiceProvider();
            var tenantLogic       = serviceProvider.GetService <TenantLogic>();

            Assert.Null(tenantLogic);

            serviceCollection.AddDatabaseClasses(databaseConfiguration);
            serviceProvider = serviceCollection.BuildServiceProvider();
            tenantLogic     = serviceProvider.GetService <TenantLogic>();
            Assert.NotNull(tenantLogic);
        }