added parallel test execution support for ncrunch.

This commit is contained in:
kay.one 2013-01-19 12:59:36 -08:00
commit ff09773a3b
13 changed files with 70 additions and 23 deletions

View file

@ -16,7 +16,12 @@ namespace NzbDrone.Core.Test.Framework
{
internal static class TestDbHelper
{
private const string DB_TEMPLATE_NAME = "_dbtemplate.sdf";
private static readonly string dbTemplateName;
static TestDbHelper()
{
dbTemplateName = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()) + ".sdf";
}
internal static string ConnectionString { get; private set; }
@ -30,7 +35,7 @@ namespace NzbDrone.Core.Test.Framework
fileName = Guid.NewGuid() + ".sdf";
}
File.Copy(DB_TEMPLATE_NAME, fileName);
File.Copy(dbTemplateName, fileName);
ConnectionString = ConnectionFactory.GetConnectionString(fileName);
@ -46,7 +51,7 @@ namespace NzbDrone.Core.Test.Framework
internal static void CreateDataBaseTemplate()
{
Console.WriteLine("Creating an empty PetaPoco database");
var connectionString = ConnectionFactory.GetConnectionString(DB_TEMPLATE_NAME);
var connectionString = ConnectionFactory.GetConnectionString(dbTemplateName);
var database = ConnectionFactory.GetPetaPocoDb(connectionString);
database.Dispose();
}