mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-23 22:25:14 -04:00
Reformat and apply Stylecop rules
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Unity;
|
||||
using Moq;
|
||||
using Unity.Strategies;
|
||||
using Unity;
|
||||
using Unity.Builder;
|
||||
using Unity.Strategies;
|
||||
|
||||
namespace NzbDrone.Test.Common.AutoMoq.Unity
|
||||
{
|
||||
@@ -36,8 +36,6 @@ namespace NzbDrone.Test.Common.AutoMoq.Unity
|
||||
}
|
||||
}
|
||||
|
||||
#region private methods
|
||||
|
||||
private bool AMockObjectShouldBeCreatedForThisType(Type type)
|
||||
{
|
||||
var mocker = _container.Resolve<AutoMoqer>();
|
||||
@@ -78,7 +76,5 @@ namespace NzbDrone.Test.Common.AutoMoq.Unity
|
||||
{
|
||||
return new[] { typeof(object[]) };
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace NzbDrone.Test.Common.AutoMoq.Unity
|
||||
{
|
||||
public class AutoMockingContainerExtension : UnityContainerExtension
|
||||
{
|
||||
private readonly IList<Type> registeredTypes = new List<Type>();
|
||||
private readonly IList<Type> _registeredTypes = new List<Type>();
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
@@ -15,25 +15,21 @@ namespace NzbDrone.Test.Common.AutoMoq.Unity
|
||||
SetBuildingStrategyForBuildingUnregisteredTypes();
|
||||
}
|
||||
|
||||
#region private methods
|
||||
|
||||
private void SetEventsOnContainerToTrackAllRegisteredTypes()
|
||||
{
|
||||
Context.Registering += ((sender, e) => RegisterType(e.TypeFrom));
|
||||
Context.RegisteringInstance += ((sender, e) => RegisterType(e.RegisteredType));
|
||||
Context.Registering += (sender, e) => RegisterType(e.TypeFrom);
|
||||
Context.RegisteringInstance += (sender, e) => RegisterType(e.RegisteredType);
|
||||
}
|
||||
|
||||
private void RegisterType(Type typeToRegister)
|
||||
{
|
||||
registeredTypes.Add(typeToRegister);
|
||||
_registeredTypes.Add(typeToRegister);
|
||||
}
|
||||
|
||||
private void SetBuildingStrategyForBuildingUnregisteredTypes()
|
||||
{
|
||||
var strategy = new AutoMockingBuilderStrategy(registeredTypes, Container);
|
||||
var strategy = new AutoMockingBuilderStrategy(_registeredTypes, Container);
|
||||
Context.Strategies.Add(strategy, UnityBuildStage.PreCreation);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user