mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-26 22:46:53 -04:00
Update FluentMigrator to v4
This commit is contained in:
@@ -5,6 +5,8 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using FluentMigrator.Runner;
|
||||
using Marr.Data;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
@@ -96,9 +98,15 @@ namespace NzbDrone.Core.Test.Framework
|
||||
return testDb;
|
||||
}
|
||||
|
||||
protected virtual void SetupLogging()
|
||||
{
|
||||
Mocker.SetConstant<ILoggerProvider>(NullLoggerProvider.Instance);
|
||||
}
|
||||
|
||||
protected void SetupContainer()
|
||||
{
|
||||
WithTempAsAppPath();
|
||||
SetupLogging();
|
||||
|
||||
Mocker.SetConstant<IConnectionStringFactory>(Mocker.Resolve<ConnectionStringFactory>());
|
||||
Mocker.SetConstant<IMigrationController>(Mocker.Resolve<MigrationController>());
|
||||
@@ -127,4 +135,4 @@ namespace NzbDrone.Core.Test.Framework
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using FluentMigrator;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
using NzbDrone.Test.Common.AutoMoq;
|
||||
@@ -36,13 +37,15 @@ namespace NzbDrone.Core.Test.Framework
|
||||
return db.GetDirectDataMapper();
|
||||
}
|
||||
|
||||
protected override void SetupLogging()
|
||||
{
|
||||
Mocker.SetConstant<ILoggerProvider>(Mocker.Resolve<MigrationLoggerProvider>());
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public override void SetupDb()
|
||||
{
|
||||
SetupContainer();
|
||||
}
|
||||
|
||||
[Obsolete("Don't use Mocker/Repositories in MigrationTests, query the DB.", true)]
|
||||
public new AutoMoqer Mocker => base.Mocker;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user