<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Net.Code.ADONet.Tests.Integration.Databases;

namespace Net.Code.ADONet.Tests.Integration.TestSupport
{


    public class AssemblyLevelInit
    {
        private IDictionary<Type, bool> _available = new Dictionary<Type, bool>();
        public AssemblyLevelInit()
        {
            var q =
                from t in Assembly.GetExecutingAssembly().GetTypes()
                where typeof (IDatabaseImpl).IsAssignableFrom(t)
                      && !t.IsInterface && !t.IsAbstract
                select Activator.CreateInstance(t);

            var supportedDbs = q.OfType<IDatabaseImpl>().ToArray();

            foreach (var db in supportedDbs)
            {
                var isAvailable = db.IsAvailable();
                _available[db.GetType()] = isAvailable;
                if (isAvailable)
                    db.DropAndRecreate();
            }
        }

        public bool IsAvailable(IDatabaseImpl impl)<commit_msg>small cleanup<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Net.Code.ADONet.Tests.Integration.Databases;

namespace Net.Code.ADONet.Tests.Integration.TestSupport
{


    public class AssemblyLevelInit
    {
        private IDictionary<Type, bool> _available = new Dictionary<Type, bool>();
        public AssemblyLevelInit()
        {
            var q =
                from t in Assembly.GetExecutingAssembly().GetTypes()
                where typeof (IDatabaseImpl).IsAssignableFrom(t)
                      && !t.IsInterface && !t.IsAbstract
                select (IDatabaseImpl)Activator.CreateInstance(t);

            var supportedDbs = q.ToArray();

            foreach (var db in supportedDbs)
            {
                var isAvailable = db.IsAvailable();
                _available[db.GetType()] = isAvailable;
                if (isAvailable)
                    db.DropAndRecreate();
            }
        }

        public bool IsAvailable(IDatabaseImpl impl)
{'fraction_non_alphanumeric': 0.09116945107398568, 'fraction_numerical': 0.0, 'mean_word_length': 2.0245310245310244, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6889243', 'n_tokens_mistral': 559, 'n_tokens_neox': 535, 'n_words': 114}