Changes to allow using container from third party tests
This commit is contained in:
@@ -37,7 +37,7 @@ namespace Umbraco.Core.Composing
|
||||
/// <summary>
|
||||
/// Gets or sets the DI container.
|
||||
/// </summary>
|
||||
internal static IContainer Container
|
||||
public static IContainer Container
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -34,6 +34,8 @@ namespace Umbraco.Tests.TestHelpers
|
||||
|
||||
var container = Current.Container = ContainerFactory.Create();
|
||||
|
||||
PreSetUp();
|
||||
|
||||
container.RegisterSingleton<ILogger>(factory => Mock.Of<ILogger>());
|
||||
container.RegisterSingleton<IProfiler>(factory => Mock.Of<IProfiler>());
|
||||
|
||||
@@ -55,6 +57,9 @@ namespace Umbraco.Tests.TestHelpers
|
||||
SetUp();
|
||||
}
|
||||
|
||||
public virtual void PreSetUp()
|
||||
{}
|
||||
|
||||
public virtual void SetUp()
|
||||
{}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Umbraco.Web.Composing
|
||||
/// <summary>
|
||||
/// Gets the DI container.
|
||||
/// </summary>
|
||||
internal static IContainer Container
|
||||
public static IContainer Container
|
||||
=> CoreCurrent.Container;
|
||||
|
||||
#region Temp & Special
|
||||
|
||||
Reference in New Issue
Block a user