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

            AirportInitializer.Seed().Wait();
        }
Esempio 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();
        }
Esempio 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();
        }
Esempio 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();
        }
Esempio n. 5
0
 public void TearDown()
 {
     AirportInitializer.AntiSeed().Wait();
     UnitOfWork.Dispose();
 }