Exemple #1
0
        public void TestBuild_VerifyDependendencyObjectsAreNotNull()
        {
            var serviceCollection = new ServiceCollection();
            var configuration     = new Mock <IConfiguration>();

            configuration.Setup(config => config.GetSection("Database").GetSection("Connection").Value).Returns("DummyConnection");
            DIBuilder.Build(serviceCollection, configuration.Object);
            var sp     = serviceCollection.BuildServiceProvider();
            var result = sp.GetService <ITaskRepository>();

            Assert.NotNull(result);
            var dbContext = sp.GetService <TaskDbContext>();

            Assert.NotNull(dbContext);
        }
Exemple #2
0
 protected virtual void BuildOtherLayerServices(IServiceCollection services)
 {
     DIBuilder.Build(services, Configuration);
 }