public void Setup() { AirportDbContext = EndpointsTestsSetup.GetAirportDbContext(); AirportInitializer = EndpointsTestsSetup.GetAirportInitializer(EndpointsTestsSetup.GetAirportDbContext()); AirportInitializer.Seed().Wait(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, AirportInitializer airportInitializer) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseErrorHandlingMiddleware(); app.UseMvc(); airportInitializer.Seed().Wait(); }
public void Setup() { AlwaysValidValidator = A.Fake <IValidator <AirhostessDTO> >(); var validValidationResult = new ValidationResult(); A.CallTo(() => AlwaysValidValidator.Validate(A <AirhostessDTO> ._)).Returns(validValidationResult); AirportDbContext = ServicesTestsSetup.GetAirportDbContext(); AirportInitializer = ServicesTestsSetup.GetAirportInitializer(ServicesTestsSetup.GetAirportDbContext()); UnitOfWork = ServicesTestsSetup.GetUnitOfWork(AirportDbContext); AirportInitializer.Seed().Wait(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, AirportInitializer airportInitializer) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseCors(builder => builder.WithOrigins("http://localhost:4200") .AllowAnyHeader() .AllowCredentials() .AllowAnyMethod() ); app.UseErrorHandlingMiddleware(); app.UseMvc(); airportInitializer.Seed().Wait(); }