public void Initialize() { var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly()); XmlConfigurator.Configure(logRepository, new FileInfo("Log4Net.config")); FlightsManagmentSystemConfig.Instance.Init("FlightsManagmentSystemTests.Config.json"); TestsDAOPGSQL.ClearDB(); Init_Airline_Facade_Data(); }
private void Init_Anonymous_Data() { _logger.Debug($"Start Init Anonymous Tests Data"); TestsDAOPGSQL.ClearDB(); string username = "******"; string password = "******"; system.TryLogin(username, password, out ILoginToken admin_token, out FacadeBase admin_facade); LoggedInAdministratorFacade loggedInAdministratorFacade = admin_facade as LoggedInAdministratorFacade; LoginToken <Administrator> adminLoginToken = admin_token as LoginToken <Administrator>; int country_id = loggedInAdministratorFacade.CreateNewCountry(adminLoginToken, TestData.Get_Countries_Data()[0]); loggedInAdministratorFacade.CreateNewCountry(adminLoginToken, TestData.Get_Countries_Data()[1]); loggedInAdministratorFacade.CreateNewCountry(adminLoginToken, TestData.Get_Countries_Data()[2]); loggedInAdministratorFacade.CreateNewCustomer(adminLoginToken, TestData.Get_Customers_Data()[0]); AirlineCompany airlineCompany = TestData.Get_AirlineCompanies_Data()[0]; airlineCompany.CountryId = country_id; loggedInAdministratorFacade.CreateNewAirlineCompany(adminLoginToken, airlineCompany); system.TryLogin(TestData.Get_AirlineCompanies_Data()[0].User.UserName, TestData.Get_AirlineCompanies_Data()[0].User.Password, out ILoginToken token, out FacadeBase facade); LoginToken <AirlineCompany> airline_token = token as LoginToken <AirlineCompany>; LoggedInAirlineFacade airline_facade = facade as LoggedInAirlineFacade; Flight flight = TestData.Get_Flights_Data_For_Anonymous_Tests()[0]; Flight flight2 = TestData.Get_Flights_Data_For_Anonymous_Tests()[1]; Flight flight3 = TestData.Get_Flights_Data_For_Anonymous_Tests()[2]; Flight flight4 = TestData.Get_Flights_Data_For_Anonymous_Tests()[3]; Flight flight5 = TestData.Get_Flights_Data_For_Anonymous_Tests()[4]; Flight flight6 = TestData.Get_Flights_Data_For_Anonymous_Tests()[5]; long flight_id = airline_facade.CreateFlight(airline_token, flight); long flight_id2 = airline_facade.CreateFlight(airline_token, flight2); long flight_id3 = airline_facade.CreateFlight(airline_token, flight3); long flight_id4 = airline_facade.CreateFlight(airline_token, flight4); long flight_id5 = airline_facade.CreateFlight(airline_token, flight5); long flight_id6 = airline_facade.CreateFlight(airline_token, flight6); flight.Id = flight_id; flight2.Id = flight_id2; flight3.Id = flight_id3; flight4.Id = flight_id4; flight5.Id = flight_id5; flight6.Id = flight_id6; _logger.Debug($"End Init Anonymous Tests Data"); }
public static void AssemblyCleanup() { TestsDAOPGSQL.ClearDB(); }