Moving content xml test to seperate test class for easier teardown of test.

Adding test to account for UserService using httpcontext for looking up current backoffice user.
This commit is contained in:
sitereactor
2012-11-06 12:42:59 -01:00
parent ec9880968f
commit 4234bb1cd9
4 changed files with 115 additions and 45 deletions

View File

@@ -55,8 +55,11 @@ namespace Umbraco.Tests.TestHelpers
RequestContext = MockRepository.GenerateMock<RequestContext>();
//Request
//Cookie collection
var cookieCollection = new HttpCookieCollection();
cookieCollection.Add(new HttpCookie("UMB_UCONTEXT", "FBA996E7-D6BE-489B-B199-2B0F3D2DD826"));
//Request
var request = MockRepository.GenerateMock<HttpRequestBase>();
request.Stub(x => x.AppRelativeCurrentExecutionFilePath).Return("~" + fullUrl.AbsolutePath);
request.Stub(x => x.PathInfo).Return(string.Empty);
@@ -64,7 +67,7 @@ namespace Umbraco.Tests.TestHelpers
request.Stub(x => x.RequestContext).Return(RequestContext);
request.Stub(x => x.Url).Return(fullUrl);
request.Stub(x => x.ApplicationPath).Return("/");
request.Stub(x => x.Cookies).Return(new HttpCookieCollection());
request.Stub(x => x.Cookies).Return(cookieCollection);
request.Stub(x => x.ServerVariables).Return(new NameValueCollection());
var queryStrings = HttpUtility.ParseQueryString(fullUrl.Query);
request.Stub(x => x.QueryString).Return(queryStrings);