public BlogContextSeedDataTests()
 {
     //Startup startup = new Startup(CallContextServiceLocator.Locator.ServiceProvider.GetRequiredService<IApplicationEnvironment>());
     this._bc = this.mockBlogContext.Object;
     this._bcsd = new BlogContextSeedData(this._bc);
     //this._bcsd.EnsureClearData();
 }
Exemplo n.º 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, BlogContextSeedData blodSeeder)
        {
            //app.UseIISPlatformHandler();
            app.UseStaticFiles();

            app.UseMvc(config =>
            {
                config.MapRoute(
                    name: "BlogArticle",
                    template: "Blog/BlogArticle/{articleId:int}",
                    defaults: new { controller = "Blog", action = "BlogArticle" }
                    );
                config.MapRoute(
                    name: "BlogArticlesInCategory",
                    template: "Blog/BlogArticlesInCategory/{categoryId:int}",
                    defaults: new { controller = "Blog", action = "BlogArticlesInCategory" }
                    );
                config.MapRoute(
                    name: "AddArticle",
                    template: "Blog/AddArticle",
                    defaults: new { controller = "Blog", action = "AddArticle" }
                    );
                config.MapRoute(
                    name: "AddCategory",
                    template: "Blog/AddCategory",
                    defaults: new { controller = "Blog", action = "AddCategory" }
                    );
                config.MapRoute(
                    name: "CkeditorUploadImag",
                    template: "Blog/CkeditorUploadImag",
                    defaults: new { controller = "Blog", action = "CkeditorUploadImag" }
                    );
                config.MapRoute(
                    name: "UploadFile",
                    template: "Blog/UploadFile",
                    defaults: new { controller = "Blog", action = "UploadFile" }
                    );
                config.MapRoute(
                    name: "Publications",
                    template: "Publications/Index",
                    defaults: new { controller = "Publications", action = "Index" }
                    );
                config.MapRoute(
                    name: "Default",
                    template: "{controller}/{action}/{id?}",
                    defaults: new { controller = "HomePage", action = "Index" }
                    );
            });

            //blodSeeder.EnsureSeedData();
            //app.Run(async (context) =>
            //{
            //    await context.Response.WriteAsync("Hello World!");
            //});
        }