Update unity

pull/3307/head
ta264 5 years ago committed by Taloth
parent 1564208e83
commit 0f6da1873e

@ -6,11 +6,12 @@ using System.Linq;
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 @@ namespace NzbDrone.Test.Common.AutoMoq.Unity
_container = container;
}
public override void PreBuildUp(IBuilderContext context)
public override void PreBuildUp(ref BuilderContext context)
{
var autoMoqer = _container.Resolve<AutoMoqer>();
@ -43,12 +42,11 @@ namespace NzbDrone.Test.Common.AutoMoq.Unity
{
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.Type;
}
private bool TypeIsNotRegistered(Type type)
@ -82,4 +80,4 @@ namespace NzbDrone.Test.Common.AutoMoq.Unity
#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 @@ namespace NzbDrone.Test.Common.AutoMoq.Unity
#endregion
}
}
}

@ -10,7 +10,7 @@
<PackageReference Include="NLog" Version="4.6.6" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="RestSharp" Version="106.6.10" />
<PackageReference Include="Unity" Version="2.1.505.2" />
<PackageReference Include="Unity" Version="5.11.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NzbDrone.Common\Sonarr.Common.csproj" />

Loading…
Cancel
Save