1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-27 22:57:09 -04:00

Cache database for Unit tests to avoid repeated migrations

This commit is contained in:
ta264
2020-02-25 21:53:40 +00:00
committed by Qstick
parent d6cac3add8
commit f3308827d0
3 changed files with 71 additions and 5 deletions
@@ -0,0 +1,26 @@
using System.IO;
using NUnit.Framework;
namespace NzbDrone.Core.Test
{
[SetUpFixture]
public class RemoveCachedDatabase
{
[OneTimeSetUp]
[OneTimeTearDown]
public void ClearCachedDatabase()
{
var mainCache = Path.Combine(TestContext.CurrentContext.TestDirectory, $"cached_Main.db");
if (File.Exists(mainCache))
{
File.Delete(mainCache);
}
var logCache = Path.Combine(TestContext.CurrentContext.TestDirectory, $"cached_Log.db");
if (File.Exists(logCache))
{
File.Delete(logCache);
}
}
}
}