Пример #1
0
    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        StartupBase <IdentityUser, IdentityDbContext> .DisableFilePolling(env);

        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
            app.UseMigrationsEndPoint();
        }
        else
        {
            app.UseExceptionHandler("/Error");
            app.UseHsts();
        }

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

        app.UseRouting();

        app.UseAuthentication();
        app.UseAuthorization();

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapDefaultControllerRoute();
        });
    }
        public static async Task AssertState(StartupBase startup, ApplicationState targetState, TimeSpan timeOut)
        {
            Func <Task <bool> > func = () =>
            {
                TestContext.Out.WriteLine(startup.Context.AppState.State);
                return(Task.FromResult(startup.Context.AppState.State == targetState));
            };

            await AssertDuringPeriod(
                func,
                timeOut,
                $"Unable to rich auditor {targetState} state."
                );
        }
Пример #3
0
 static void Main(string[] args)
 {
     StartupBase.Run <Startup>(null);
 }