Radarr/src/NzbDrone.Core.Test/Framework/DbTestCleanup.cs

29 lines
708 B
C#
Raw Normal View History

using System.IO;
using NUnit.Framework;
2022-03-28 20:46:21 +00:00
using NzbDrone.Core.Datastore.Migration.Framework;
using NzbDrone.Test.Common.Datastore;
namespace NzbDrone.Core.Test
{
[SetUpFixture]
public class RemoveCachedDatabase
{
[OneTimeSetUp]
[OneTimeTearDown]
public void ClearCachedDatabase()
{
2022-03-28 20:46:21 +00:00
var mainCache = SqliteDatabase.GetCachedDb(MigrationType.Main);
if (File.Exists(mainCache))
{
File.Delete(mainCache);
}
2022-03-28 20:46:21 +00:00
var logCache = SqliteDatabase.GetCachedDb(MigrationType.Log);
if (File.Exists(logCache))
{
File.Delete(logCache);
}
}
}
}