Beispiel #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, SchoolContext context, IdentityDB ident,
                              RoleManager <IdentityRole> roleManager, UserManager <IdentityUser> userManager)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseCookiePolicy();
            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            DatabaseTestData.InitializeAsync(context, ident, userManager, roleManager).Wait();
        }
Beispiel #2
0
        public void LogsTestData()
        {
            var settings       = new ConnectionSettings("server", "db", true, null, null);
            var taskAttributes = new TaskAttributes(settings, "c:\\scripts");

            taskAttributes.RequestedDatabaseAction = RequestedDatabaseAction.TestData;
            var mocks        = new MockRepository();
            var executor     = mocks.StrictMock <IScriptFolderExecutor>();
            var taskObserver = mocks.StrictMock <ITaskObserver>();

            using (mocks.Record())
            {
                executor.ExecuteTestDataScriptsInFolder(taskAttributes, "TestData", taskObserver);
            }

            using (mocks.Playback())
            {
                IDatabaseActionExecutor testdata = new DatabaseTestData(executor);
                testdata.Execute(taskAttributes, taskObserver);
            }

            mocks.VerifyAll();
        }