Exemplo n.º 1
0
        public void BeforeEach()
        {
            var log       = new CustomLogData(l => Debug.WriteLine(l));
            var logwriter = new RegionBasedLogWriter(log, nameof(PostgreSqlProviderTests));

            logwriter.StartStopwatch();

            provider = new PostgreSqlProvider(connectionPool, logwriter, SCHEMA);
            provider.EnsureSchemaExists();

            var tables = provider.GetTableNamesBySchema(SCHEMA);

            foreach (var table in tables)
            {
                provider.DropTable(table);
            }
        }
Exemplo n.º 2
0
        public void BeforeEach()
        {
            var log = new CustomLogData(l => Debug.WriteLine(l));

            logwriter   = new RegionBasedLogWriter(log, "Spec");
            sqlProvider = new PostgreSqlProvider(connectionPool, logwriter.NewRegion(nameof(PostgreSqlProvider)), SCHEMA);
            sqlProvider.EnsureSchemaExists();

            typeManager = new TypeManager();
            typeManager.Register <DeviceType>();
            typeManager.Register <SensorType>();

            entityProvider = new EntityProvider(sqlProvider, logwriter.NewRegion(nameof(EntityProvider)));
            provider       = new ItemProvider(entityProvider, typeManager, logwriter.NewRegion(nameof(ItemProvider)));

            var tables = sqlProvider.GetTableNamesBySchema(SCHEMA);

            foreach (var table in tables)
            {
                sqlProvider.DropTable(table);
            }
        }