Fixes service context ctor to allow IMacroService
This commit is contained in:
@@ -65,6 +65,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="auditService"></param>
|
||||
/// <param name="domainService"></param>
|
||||
/// <param name="taskService"></param>
|
||||
/// <param name="macroService"></param>
|
||||
public ServiceContext(
|
||||
IContentService contentService = null,
|
||||
IMediaService mediaService = null,
|
||||
@@ -86,7 +87,8 @@ namespace Umbraco.Core.Services
|
||||
ILocalizedTextService localizedTextService = null,
|
||||
IAuditService auditService = null,
|
||||
IDomainService domainService = null,
|
||||
ITaskService taskService = null)
|
||||
ITaskService taskService = null,
|
||||
IMacroService macroService = null)
|
||||
{
|
||||
if (auditService != null) _auditService = new Lazy<IAuditService>(() => auditService);
|
||||
if (localizedTextService != null) _localizedTextService = new Lazy<ILocalizedTextService>(() => localizedTextService);
|
||||
@@ -109,6 +111,7 @@ namespace Umbraco.Core.Services
|
||||
if (notificationService != null) _notificationService = new Lazy<INotificationService>(() => notificationService);
|
||||
if (domainService != null) _domainService = new Lazy<IDomainService>(() => domainService);
|
||||
if (taskService != null) _taskService = new Lazy<ITaskService>(() => taskService);
|
||||
if (macroService != null) _macroService = new Lazy<IMacroService>(() => macroService);
|
||||
}
|
||||
|
||||
internal ServiceContext(
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Umbraco.Tests.Routing
|
||||
protected ServiceContext GetServiceContext(IUmbracoSettingsSection umbracoSettings, ILogger logger)
|
||||
{
|
||||
//get the mocked service context to get the mocked domain service
|
||||
var svcCtx = MockHelper.GetMockedServiceContext(umbracoSettings, logger);
|
||||
var svcCtx = MockHelper.GetMockedServiceContext();
|
||||
var domainService = Mock.Get(svcCtx.DomainService);
|
||||
//setup mock domain service
|
||||
domainService.Setup(service => service.GetAll(It.IsAny<bool>()))
|
||||
|
||||
@@ -33,7 +33,9 @@ namespace Umbraco.Tests.TestHelpers
|
||||
new Mock<INotificationService>().Object,
|
||||
new Mock<ILocalizedTextService>().Object,
|
||||
new Mock<IAuditService>().Object,
|
||||
new Mock<IDomainService>().Object);
|
||||
new Mock<IDomainService>().Object,
|
||||
new Mock<ITaskService>().Object,
|
||||
new Mock<IMacroService>().Object);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user