AssetManager.Tests.Controllers.ParentControllerTest.SetUpIdentity C# (CSharp) Method

SetUpIdentity() protected method

protected SetUpIdentity ( ) : void
return void
        protected void SetUpIdentity()
        {
            HttpContext.Current = new HttpContext(
                new HttpRequest("", "http://tempuri.org", ""),
                new HttpResponse(new StringWriter())
                );

            // User is logged in
            HttpContext.Current.User = new GenericPrincipal(
                new GenericIdentity("username"),
                new string[0]
                );
        }