1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-21 22:05:43 -04:00

Fixed: Automation/Integration/Unit Tests

This commit is contained in:
Qstick
2019-09-02 22:22:25 -04:00
parent 944f420270
commit 7f221c7834
123 changed files with 1384 additions and 1191 deletions
+9 -16
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.IO;
using System.Linq;
using FluentMigrator.Runner;
@@ -99,7 +100,6 @@ namespace NzbDrone.Core.Test.Framework
{
WithTempAsAppPath();
Mocker.SetConstant<IAnnouncer>(Mocker.Resolve<MigrationLogger>());
Mocker.SetConstant<IConnectionStringFactory>(Mocker.Resolve<ConnectionStringFactory>());
Mocker.SetConstant<IMigrationController>(Mocker.Resolve<MigrationController>());
@@ -116,22 +116,15 @@ namespace NzbDrone.Core.Test.Framework
[TearDown]
public void TearDown()
{
if (TestFolderInfo != null && Directory.Exists(TestFolderInfo.AppDataFolder))
// Make sure there are no lingering connections. (When this happens it means we haven't disposed something properly)
GC.Collect();
GC.WaitForPendingFinalizers();
SQLiteConnection.ClearAllPools();
if (TestFolderInfo != null)
{
var files = Directory.GetFiles(TestFolderInfo.AppDataFolder);
foreach (var file in files)
{
try
{
File.Delete(file);
}
catch (Exception)
{
}
}
DeleteTempFolder(TestFolderInfo.AppDataFolder);
}
}
}
}
}