2020-02-25 21:53:40 +00:00
|
|
|
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;
|
2020-02-25 21:53:40 +00:00
|
|
|
|
|
|
|
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);
|
2020-02-25 21:53:40 +00:00
|
|
|
if (File.Exists(mainCache))
|
|
|
|
{
|
|
|
|
File.Delete(mainCache);
|
|
|
|
}
|
|
|
|
|
2022-03-28 20:46:21 +00:00
|
|
|
var logCache = SqliteDatabase.GetCachedDb(MigrationType.Log);
|
2020-02-25 21:53:40 +00:00
|
|
|
if (File.Exists(logCache))
|
|
|
|
{
|
|
|
|
File.Delete(logCache);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|