Fixes service context ctor to allow IMacroService

This commit is contained in:
Shannon
2015-01-27 14:58:59 +11:00
parent a5c1b0b2f2
commit f8600725b2
3 changed files with 8 additions and 3 deletions

View File

@@ -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(

View File

@@ -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>()))

View File

@@ -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);
}
}
}