Cleanup UmbracoContext

This commit is contained in:
Stephan
2016-10-18 17:09:26 +02:00
parent 88593b0bf3
commit 33a773a0b9
17 changed files with 105 additions and 160 deletions

View File

@@ -59,7 +59,7 @@ namespace Umbraco.Tests.PublishedContent
var umbracoContext = GetUmbracoContext("/test");
//set the UmbracoContext.Current since the extension methods rely on it
Umbraco.Web.Current.SetUmbracoContext(umbracoContext, true);
Umbraco.Web.Current.UmbracoContextAccessor.UmbracoContext = umbracoContext;
}
public override void TearDown()

View File

@@ -64,14 +64,14 @@ namespace Umbraco.Tests.PublishedContent
facadeService.Setup(x => x.CreateFacade(It.IsAny<string>())).Returns(facade);
var httpContext = GetHttpContextFactory("http://umbraco.local/", routeData).HttpContext;
var umbracoContext = UmbracoContext.CreateContext(
var umbracoContext = new UmbracoContext(
httpContext,
facadeService.Object,
new WebSecurity(httpContext, Current.Services.UserService),
TestObjects.GetUmbracoSettings(),
Enumerable.Empty<IUrlProvider>());
Umbraco.Web.Current.SetUmbracoContext(umbracoContext, true);
Umbraco.Web.Current.UmbracoContextAccessor.UmbracoContext = umbracoContext;
}
public override void TearDown()

View File

@@ -27,7 +27,7 @@ namespace Umbraco.Tests.PublishedContent
ContentTypesCache.GetPublishedContentTypeByAlias = (alias) => type;
var umbracoContext = GetUmbracoContext("/test");
Umbraco.Web.Current.SetUmbracoContext(umbracoContext, true);
Umbraco.Web.Current.UmbracoContextAccessor.UmbracoContext = umbracoContext;
}
protected override void MoreSetUp()