U4-8497 - fixing tests...

This commit is contained in:
Stephan
2016-05-26 19:20:33 +02:00
parent 23ce1e5b6e
commit 2e4e8a3fbc
6 changed files with 52 additions and 23 deletions

View File

@@ -103,9 +103,14 @@ namespace Umbraco.Tests.Web.Mvc
CacheHelper.CreateDisabledCacheHelper(),
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
var facade = new Mock<IFacade>();
facade.Setup(x => x.MemberCache).Returns(Mock.Of<IPublishedMemberCache>());
var facadeService = new Mock<IFacadeService>();
facadeService.Setup(x => x.CreateFacade(It.IsAny<string>())).Returns(facade.Object);
var umbCtx = UmbracoContext.EnsureContext(
new Mock<HttpContextBase>().Object, appCtx,
Mock.Of<IFacadeService>(),
facadeService.Object,
new Mock<WebSecurity>(null, null).Object,
Mock.Of<IUmbracoSettingsSection>(section => section.WebRouting == Mock.Of<IWebRoutingSection>(routingSection => routingSection.UrlProviderMode == "AutoLegacy")),
Enumerable.Empty<IUrlProvider>(),

View File

@@ -19,6 +19,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Persistence.UnitOfWork;
using Umbraco.Core.Profiling;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.Stubs;
using Umbraco.Web;
@@ -437,7 +438,7 @@ namespace Umbraco.Tests.Web.Mvc
var cache = new NullCacheProvider();
var provider = new NPocoUnitOfWorkProvider(databaseFactory, new RepositoryFactory(Mock.Of<IServiceContainer>()));
_service = new FacadeService(svcCtx, provider, cache, true, false); // no events
_service = new FacadeService(svcCtx, provider, cache, Enumerable.Empty<IUrlSegmentProvider>(), true, false); // no events
var http = GetHttpContextFactory(url, routeData).HttpContext;