don't log migrations during regular DB tests

pull/4/head
Keivan Beigi 8 years ago
parent d5e720c404
commit f25bfe9d28
No known key found for this signature in database
GPG Key ID: C536675AC49003C0

@ -99,7 +99,6 @@ namespace NzbDrone.Core.Test.Framework
{ {
WithTempAsAppPath(); WithTempAsAppPath();
Mocker.SetConstant<IAnnouncer>(Mocker.Resolve<MigrationLogger>());
Mocker.SetConstant<IConnectionStringFactory>(Mocker.Resolve<ConnectionStringFactory>()); Mocker.SetConstant<IConnectionStringFactory>(Mocker.Resolve<ConnectionStringFactory>());
Mocker.SetConstant<IMigrationController>(Mocker.Resolve<MigrationController>()); Mocker.SetConstant<IMigrationController>(Mocker.Resolve<MigrationController>());

@ -1,8 +1,8 @@
using System; using System;
using FluentMigrator; using FluentMigrator;
using FluentMigrator.Runner;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Core.Datastore.Migration.Framework; using NzbDrone.Core.Datastore.Migration.Framework;
using NzbDrone.Test.Common.AutoMoq;
namespace NzbDrone.Core.Test.Framework namespace NzbDrone.Core.Test.Framework
{ {
@ -26,7 +26,7 @@ namespace NzbDrone.Core.Test.Framework
BeforeMigration = m => BeforeMigration = m =>
{ {
var migration = m as TMigration; var migration = m as TMigration;
if (beforeMigration != null && migration is TMigration) if (beforeMigration != null && migration != null)
{ {
beforeMigration(migration); beforeMigration(migration);
} }
@ -39,10 +39,8 @@ namespace NzbDrone.Core.Test.Framework
[SetUp] [SetUp]
public override void SetupDb() public override void SetupDb()
{ {
Mocker.SetConstant<IAnnouncer>(Mocker.Resolve<MigrationLogger>());
SetupContainer(); 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() public override void Up()
{ {
if (Context.BeforeMigration != null) if (Context.BeforeMigration != null)
{ {
Context.BeforeMigration(this); Context.BeforeMigration(this);

Loading…
Cancel
Save