Ejemplo n.º 1
0
        public void ApplyToContext(TestExecutionContext context)
        {
            if (resetDatabase)
            {
                if (!DatabaseWrapper.Initialized)
                {
                    throw new Exception("Database is not initialized");
                }

                DatabaseWrapper.RestoreLastbackup();
            }

            if (scriptFiles != null && scriptFiles.Length > 0)
            {
                foreach (var scriptFile in scriptFiles)
                {
                    if (!string.IsNullOrWhiteSpace(scriptFile))
                    {
                        DatabaseWrapper.RunScript(scriptFile);
                    }
                }
            }
        }