mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
New: Update Unity
This commit is contained in:
parent
8b9d64b15a
commit
53ffc9867c
@ -6,11 +6,12 @@
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.Practices.Unity;
|
||||
using Unity;
|
||||
using Moq;
|
||||
using Moq.Language.Flow;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Test.Common.AutoMoq.Unity;
|
||||
using Unity.Resolution;
|
||||
|
||||
[assembly: InternalsVisibleTo("AutoMoq.Tests")]
|
||||
|
||||
|
@ -1,12 +1,11 @@
|
||||
|
||||
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.Practices.ObjectBuilder2;
|
||||
using Microsoft.Practices.Unity;
|
||||
using Unity;
|
||||
using Moq;
|
||||
using Unity.Strategies;
|
||||
using Unity.Builder;
|
||||
|
||||
namespace NzbDrone.Test.Common.AutoMoq.Unity
|
||||
{
|
||||
@ -24,7 +23,7 @@ public AutoMockingBuilderStrategy(IEnumerable<Type> registeredTypes, IUnityConta
|
||||
_container = container;
|
||||
}
|
||||
|
||||
public override void PreBuildUp(IBuilderContext context)
|
||||
public override void PreBuildUp(ref BuilderContext context)
|
||||
{
|
||||
var autoMoqer = _container.Resolve<AutoMoqer>();
|
||||
|
||||
@ -43,12 +42,12 @@ private bool AMockObjectShouldBeCreatedForThisType(Type type)
|
||||
{
|
||||
var mocker = _container.Resolve<AutoMoqer>();
|
||||
return TypeIsNotRegistered(type) && (mocker.ResolveType == null || mocker.ResolveType != type);
|
||||
//return TypeIsNotRegistered(type) && type.IsInterface;
|
||||
}
|
||||
|
||||
private static Type GetTheTypeFromTheBuilderContext(IBuilderContext context)
|
||||
private static Type GetTheTypeFromTheBuilderContext(BuilderContext context)
|
||||
{
|
||||
return (context.OriginalBuildKey).Type;
|
||||
// return (context.OriginalBuildKey).Type;
|
||||
return context.Type;
|
||||
}
|
||||
|
||||
private bool TypeIsNotRegistered(Type type)
|
||||
@ -82,4 +81,4 @@ private static Type[] EmptyArgumentList()
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Practices.Unity;
|
||||
using Microsoft.Practices.Unity.ObjectBuilder;
|
||||
using Unity.Builder;
|
||||
using Unity.Extension;
|
||||
|
||||
namespace NzbDrone.Test.Common.AutoMoq.Unity
|
||||
{
|
||||
@ -36,4 +36,4 @@ private void SetBuildingStrategyForBuildingUnregisteredTypes()
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user