//set the fake user claims
List<Claim> userClaims = new List<Claim>();
userClaims.Add(new Claim(ClaimTypes.Surname, "User"));
userClaims.Add(new Claim(ClaimTypes.GivenName, "Some"));
userClaims.Add(new Claim(ClaimTypes.Name, "Some User"));
userClaims.Add(new Claim(ClaimTypes.NameIdentifier, "12345"));
ClaimsIdentity identity = new ClaimsIdentity(userClaims, "ApplicationCookie");
var user = new System.Security.Claims.ClaimsPrincipal(identity);
//this setting of the controller context allows us to assign the user where normally the User is read only
savedQueriesController.ControllerContext = new ControllerContext
{
HttpContext = new MockHttpContext
{
User = user
}
};