public void BaseTearDown()
 {
     Client.Dispose();
     _factory.Dispose();
     RollbackEfTransaction();
     ElasticsearchTests.DeleteAddressesIndex(ElasticsearchClient);
 }
        public void OneTimeSetUp()
        {
            if (Environment.GetEnvironmentVariable("ELASTICSEARCH_DOMAIN_URL") == null)
            {
                Environment.SetEnvironmentVariable("ELASTICSEARCH_DOMAIN_URL", "http://localhost:9202");
            }

            ElasticsearchClient = ElasticsearchTests.SetupElasticsearchConnection();
            ConnectToPostgresDbUsingEf();
        }
        public async Task BaseSetup()
        {
            Environment.SetEnvironmentVariable("CONNECTION_STRING", ConnectionString.TestDatabase());
            await ElasticsearchTests.BeforeAnyElasticsearchTest(ElasticsearchClient).ConfigureAwait(true);

            _factory        = new MockWebApplicationFactory <TStartup>(_connection);
            Client          = _factory.CreateClient();
            DatabaseContext = new AddressesContext(_builder.Options);
            DatabaseContext.Database.Migrate();
            _transaction = DatabaseContext.Database.BeginTransaction();
        }