diff --git a/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssIndexerFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssIndexerFixture.cs index 37e8790fa..01f689d91 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssIndexerFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/TorrentRssIndexerTests/TorrentRssIndexerFixture.cs @@ -23,8 +23,6 @@ public class TorrentRssIndexerFixture : CoreTest [SetUp] public void Setup() { - Mocker.SetConstant(Mocker.GetMock().Object); - Mocker.SetConstant(Mocker.Resolve()); Mocker.SetConstant(Mocker.Resolve()); Mocker.SetConstant(Mocker.Resolve()); diff --git a/src/NzbDrone.Test.Common/AutoMoq/AutoMoqer.cs b/src/NzbDrone.Test.Common/AutoMoq/AutoMoqer.cs index 1796d715d..98faebac2 100644 --- a/src/NzbDrone.Test.Common/AutoMoq/AutoMoqer.cs +++ b/src/NzbDrone.Test.Common/AutoMoq/AutoMoqer.cs @@ -80,6 +80,8 @@ public virtual void SetMock(Type type, Mock mock) { if (_registeredMocks.ContainsKey(type) == false) _registeredMocks.Add(type, mock); + if (mock != null) + _container.RegisterInstance(type, mock.Object); } public virtual void SetConstant(T instance)