Exemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var domainLogicRoot = new DomainLogicRoot(new ProductSiteDownloader(), new RedisDb());

            services.AddSingleton <IGetHandler>(domainLogicRoot.GetHandler); //Adding to container only dependencies needed by framework (Controller)
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
        }
Exemplo n.º 2
0
        private ComponentDriver()
        {
            _productWebpageDownloader = Substitute.For <IProductWebpageDownloader>();
            _database = new FakeDatabase();

            var domainLogicRoot = new DomainLogicRoot(_productWebpageDownloader, _database);

            GetHandler = domainLogicRoot.GetHandler;
        }