// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ApplicationDbContext context, RoleManager <ApplicationRole> roleManager, UserManager <ApplicationUser> userManager) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } 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?}"); }); DummyUsers.Initialize(context, userManager, roleManager).Wait(); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ApplicationDbContext context, RoleManager <ApplicationRole> roleManager, UserManager <ApplicationUser> userManager) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } DummyUsers.Initialize(context, userManager, roleManager).Wait(); app.UseStaticFiles(); app.UseCors("CorsPolicy"); app.UseIdentityServer(); app.UseMvcWithDefaultRoute(); }
public async Task RunMajorUseCasesWithDummyUser() { var config = new FConfig() { TcpPort = 0 }; var dummyUsers = new DummyUsers(); var fserver = new FServer(Logger.Null, config, dummyUsers); IUserManagement users = fserver; await users.Create(_goga); await users.Update(_goga); var all = await users.List(); Assert.That(all, Is.Not.Empty); var fclient = await FClient.New(config, new ClientInfo { ServerName = fserver.ServerName, Port = fserver.Port, UserName = "******", Password = "******" }); await fclient.Upload("f-config.goga.json", "f-config.json"); await fclient.Upload("NUnit3.TestAdapter.dll.goga", "NUnit3.TestAdapter.dll"); await fclient.Download("f-config.goga.json", "f-config.copy.json"); await fclient.Download("NUnit3.TestAdapter.dll.goga", "NUnit3.TestAdapter.dll.copy"); var list = await fclient.ListFiles(); Assert.That(list, Is.Not.Empty); await fclient.Delete("f-config.goga.json"); await users.Delete(_goga, false); }