Make internals visible to Moq, otherwise we cannot mock ILogger<InternalClass>

For some reason adding the assembly attribute doesn't work for the test project, I need to look into this.
This commit is contained in:
Mole
2020-09-22 08:56:23 +02:00
parent 4917025327
commit 6cce7ef3f2
4 changed files with 11 additions and 0 deletions

View File

@@ -39,5 +39,8 @@
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Umbraco.Tests.Integration</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project>

View File

@@ -90,6 +90,9 @@
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Umbraco.Tests.UnitTests</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>

View File

@@ -27,6 +27,9 @@
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Umbraco.Tests.Benchmarks</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project>

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.SessionState;
@@ -12,6 +13,7 @@ using Umbraco.Core.Composing;
using Umbraco.Web;
using Current = Umbraco.Web.Composing.Current;
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
namespace Umbraco.Tests.TestHelpers.Stubs
{
/// <summary>