mirror of https://github.com/Sonarr/Sonarr
don't log migrations during regular DB tests
This commit is contained in:
parent
d5e720c404
commit
f25bfe9d28
|
@ -99,7 +99,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>());
|
||||
|
||||
|
|
|
@ -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 @@ namespace NzbDrone.Core.Test.Framework
|
|||
BeforeMigration = m =>
|
||||
{
|
||||
var migration = m as TMigration;
|
||||
if (beforeMigration != null && migration is TMigration)
|
||||
if (beforeMigration != null && migration != null)
|
||||
{
|
||||
beforeMigration(migration);
|
||||
}
|
||||
|
@ -39,10 +39,8 @@ namespace NzbDrone.Core.Test.Framework
|
|||
[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 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
|
|||
|
||||
public override void Up()
|
||||
{
|
||||
|
||||
if (Context.BeforeMigration != null)
|
||||
{
|
||||
Context.BeforeMigration(this);
|
||||
|
|
Loading…
Reference in New Issue