Minor corrections in BasicDataServiceTest.cs

(added more functions for cleaning up DB from the
derived tests)
soprefactor
AlexRa 2010-05-18 14:30:17 +03:00
parent 187a98615b
commit 6322a085b3
1 changed files with 41 additions and 0 deletions

View File

@ -167,5 +167,46 @@ namespace OpenSim.Data.Tests
}
}
}
/// <summary>Clear tables listed as parameters (without dropping them).
/// </summary>
/// <param name="tables"></param>
protected virtual void ResetMigrations(params string[] stores)
{
string lst = "";
foreach (string store in stores)
{
string s = "'" + store + "'";
if (lst == "")
lst = s;
else
lst += ", " + s;
}
try
{
ExecuteSql("DELETE FROM `migrations` where name in (" + lst + ");");
}
catch
{
}
}
/// <summary>Clear tables listed as parameters (without dropping them).
/// </summary>
/// <param name="tables"></param>
protected virtual void ClearTables(params string[] tables)
{
foreach (string tbl in tables)
{
try
{
ExecuteSql("DELETE FROM " + tbl + ";");
}
catch
{
}
}
}
}
}