public void DatabaseTable_IsExists(string tableName)
 {
     using (var connection = ConnectionUtil.CreateConnection(_dbConnectionString))
     {
         var sql    = $"SELECT name FROM sqlite_master where type='table' and name='{tableName}'";
         var result = connection.QueryFirstOrDefault <string>(sql);
         Assert.NotNull(result);
         Assert.Equal(tableName, result);
     }
 }
        private void InitializeDatabase()
        {
            var sqliteConn   = ConnectionUtil.GetConnectionString();
            var databaseName = ConnectionUtil.GetDatabaseName();

            if (!File.Exists(databaseName))
            {
                using (var connection = ConnectionUtil.CreateConnection(sqliteConn))
                {
                    connection.Open();
                    var storage = _serviceProvider.GetService <IStorageInitializer>();
                    var token   = new CancellationTokenSource().Token;
                    storage.InitializeAsync(token).GetAwaiter().GetResult();
                    connection.Close();
                }
            }
        }