Ejemplo n.º 1
0
        public void Setup()
        {
            AirportDbContext   = EndpointsTestsSetup.GetAirportDbContext();
            AirportInitializer = EndpointsTestsSetup.GetAirportInitializer(EndpointsTestsSetup.GetAirportDbContext());

            AirportInitializer.Seed().Wait();
        }
Ejemplo n.º 2
0
        // 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();
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        // 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();
        }