Beispiel #1
0
        public static async Task AssemblyInit(TestContext context)
        {
            var jsonconfig = File.ReadAllText("config.json");
            var schema     = File.ReadAllText("tablesUp.sql");
            var creds      = JsonSerializer.Deserialize <PgresUser>(jsonconfig);
            var dbname     = $"test_broker_{Random}";
            var newDb      = creds.ToConnection(false).NewTestDatabase(dbname);
            var newDbR     = await newDb.SubmitCommand();

            creds.Db = dbname;
            var tablesUp  = creds.ToConnection(false).RunSql(schema);
            var tablesUpR = await tablesUp.SubmitCommand();

            _factory    = WebApp.Get(ToConfig(creds));
            _dbCreds    = creds;
            _testDbName = dbname;
        }