mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
don't log migrations during regular DB tests
This commit is contained in:
parent
d5e720c404
commit
f25bfe9d28
@ -99,7 +99,6 @@ protected void SetupContainer()
|
||||
{
|
||||
WithTempAsAppPath();
|
||||
|
||||
Mocker.SetConstant<IAnnouncer>(Mocker.Resolve<MigrationLogger>());
|
||||
Mocker.SetConstant<IConnectionStringFactory>(Mocker.Resolve<ConnectionStringFactory>());
|
||||
Mocker.SetConstant<IMigrationController>(Mocker.Resolve<MigrationController>());
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using FluentMigrator;
|
||||
using FluentMigrator.Runner;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
using NzbDrone.Test.Common.AutoMoq;
|
||||
|
||||
namespace NzbDrone.Core.Test.Framework
|
||||
{
|
||||
@ -26,7 +26,7 @@ protected virtual IDirectDataMapper WithMigrationTestDb(Action<TMigration> befor
|
||||
BeforeMigration = m =>
|
||||
{
|
||||
var migration = m as TMigration;
|
||||
if (beforeMigration != null && migration is TMigration)
|
||||
if (beforeMigration != null && migration != null)
|
||||
{
|
||||
beforeMigration(migration);
|
||||
}
|
||||
@ -39,10 +39,8 @@ protected virtual IDirectDataMapper WithMigrationTestDb(Action<TMigration> befor
|
||||
[SetUp]
|
||||
public override void SetupDb()
|
||||
{
|
||||
Mocker.SetConstant<IAnnouncer>(Mocker.Resolve<MigrationLogger>());
|
||||
SetupContainer();
|
||||
}
|
||||
|
||||
[Obsolete("Don't use Mocker/Repositories in MigrationTests, query the DB.", true)]
|
||||
public new AutoMoqer Mocker => base.Mocker;
|
||||
}
|
||||
}
|
@ -46,7 +46,6 @@ public MigrationContext Context
|
||||
|
||||
public override void Up()
|
||||
{
|
||||
|
||||
if (Context.BeforeMigration != null)
|
||||
{
|
||||
Context.BeforeMigration(this);
|
||||
|
Loading…
Reference in New Issue
Block a user