mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
Ensure auto-generated mocks are also registered in the test container.
This commit is contained in:
parent
7818f0c59b
commit
b99d82cccc
@ -23,8 +23,6 @@ public class TorrentRssIndexerFixture : CoreTest<TestTorrentRssIndexer>
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
Mocker.SetConstant<IHttpClient>(Mocker.GetMock<IHttpClient>().Object);
|
||||
Mocker.SetConstant<ICacheManager>(Mocker.Resolve<CacheManager>());
|
||||
Mocker.SetConstant<ITorrentRssSettingsDetector>(Mocker.Resolve<TorrentRssSettingsDetector>());
|
||||
Mocker.SetConstant<ITorrentRssParserFactory>(Mocker.Resolve<TorrentRssParserFactory>());
|
||||
|
||||
|
@ -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>(T instance)
|
||||
|
Loading…
Reference in New Issue
Block a user